Hello!
After migrating our project from version 5.5 to 5.6, we’re seeing a 100% crash when we set our character’s SkeletalMesh physics blend to zero, then back up to a positive number, via USkeletalMeshComponent::SetAllBodiesBelowPhysicsBlendWeight.
We haven’t been able to achieve a minimal repro outside of our game’s player character, so I’m unable to provide the exact repro steps.
The root cause from what we could tell in our case was that USkeletalMeshComponent::SwapEvaluationContextBuffers being called from a parallel task that was clearing the contents of the EditableComponentSpaceTransforms.
I should note that this did not occur in 5.3, 5.4 or 5.5 for us, with the same setup, yet we were unable to find any consequential changes engine in the area between the 5.5 and 5.6 versions.
We are currently using the following engine modification in UPhysicalAnimationComponent::UpdateTargetActors to mitigate the crash to unblock our workflow:
void UPhysicalAnimationComponent::UpdateTargetActors(ETeleportType TeleportType)
{
UPhysicsAsset* PhysAsset = SkeletalMeshComponent ? SkeletalMeshComponent->GetPhysicsAsset() : nullptr;
if (PhysAsset && SkeletalMeshComponent->GetSkeletalMeshAsset())
{
const FReferenceSkeleton& RefSkeleton = SkeletalMeshComponent->GetSkeletalMeshAsset()->GetRefSkeleton();
// Note we use GetEditableComponentSpaceTransforms because we need to update target actors in the midst of the
// various anim ticks, before buffers are flipped (which happens in the skel mesh component's post-physics tick)
const TArray<FTransform>& SpaceBases = SkeletalMeshComponent->GetEditableComponentSpaceTransforms();
// @third party code - BEGIN Early out to avoid physical anim crash until Epic can fix it
if (DriveData.Num() && !SpaceBases.Num())
{
return;
}
// @third party code - END Early out to avoid physical anim crash until Epic can fix it
FPhysicsCommand::ExecuteWrite(SkeletalMeshComponent, [&]()
...
We’d like to also know if you see our above mitigation as a potential trap for other issues?
We understand that without a sharable repro, direction will be challenging. We’d be interested to hear though, of any suggestions for what we may be doing incorrectly in our project to create this out-of-order parallel issue.
Here are some links to other licensees facing similar issues that we found added helpful context:
[Crash in [Content removed]
[Crash when applying physical animation [Content removed]
Many thanks!