Crash on GetSkelMeshComponent due to AnimTickOption

Hello, after updating to Unreal Engine 5.5 we started crashing quite often due to the above mentioned AnimInstanceProxy::GetSkelMeshComponent().

After long debugging the issue seem to be based on the use of EVisibilityBasedAnimTickOption::OnlyTickMontagesAndRefreshBonesWhenPlayingMontages
If we use that tick option and we play a montage on an actor that is currently out of screen the crash happens.
The animation setup blueprint in use is setup as follow:
The actor has a skeletalMesh with a AnimationBP set, let’s call it MainAnimationBP
MainAnimationBP has a LinkedAnimGraph (SecondAnimationBP) node linked to an IKRig that then outputs to the OutputPose
SecondAnimationBP finally has most of the locomotion stuff in it, and, part of that is handled through another LinkedAnimGrap

Reverting the changes made here: https://github.com/EpicGames/UnrealEngine/commit/1615ea86ae8f4a585bbc9870a64c55bd39490c9f
Fixes the issue.

Another possible fix that we have found is to add something like:
bool bIsInitialized = false; in the AnimInstanceProxy.h
This bool is set to true at the end of FAnimInstanceProxy::InitializeObjects() and to false after FAnimInstanceProxy::ClearObjects()
Then in FAnimInstanceProxy::UpdateAnimation() we check if bIsInitialized is still false, if so we call InitializeObjects(CastChecked(GetAnimInstanceObject()));

This works because, in our testings, it seems that if we have a linked animation inside our animation blueprint the linked animation doesn’t know that the main-animation blueprint is playing a montage so we skip its update and initialization cycle

Currently I’ve decided to simply roll back the above mentioned change, I understand however that it’s not the best idea but I think the issue is deeper than I can understand so I would wait for someone to take a deeper look into it

1 Like