Physical animation component causing a crash

The physical animation component is crashing the game on start or at a random point after starting. It tries to get a return from that SpaceBases array with the BoneIndex but the SpaceBases array is empty.

Here it creates the SpaceBases:


image

I added a simple if check to the source code after the SpaceBases is created so that it doesn’t cause a crash but it still ofc gives me an error about every 1.5-2 seconds and on that frame it doesn’t update the position because of the return so it stutters a lot. I don’t know what could be causing it. When I add an empty animation bluprint to the character it doesn’t give me an error.

const TArray<FTransform>& SpaceBases = SkeletalMeshComponent->GetEditableComponentSpaceTransforms();
        if (SpaceBases.Num() == 0)
        {
            UE_LOG(LogTemp, Error, TEXT("SpaceBases array is empty"));
            return;
        }

Bump! I was able to ignore it until now before using ControlRigs but if I add ControlRig to my AnimBP the error happens constantly.
It happens more depending on what you add to your animation blueprint is what I have found out. With ControlRigs its very bad

I feel like this did not work in the previous versions but I just set the movement component to tick PostPhysics and that made the error go away.