Set Anim Instance node causing crashes
I just migrated a project from 4.18 to 4.22 and discovered an easily repeatable crash based on something I had working in 4.18. Whenever I use the Set Anim Instance node to change to a different anim blueprint, UE4 crashes.
I tested this extensively in my game and am positive that this is what's causing the crash. I tried making a blank actor with two blank anim blueprint in a blank level and simply set up the actor to switch anim instances after a couple seconds and it causes a crash. I even tried creating a new project using the third person template, making a child of the third person character's anim blueprint and then switching to it on begin play, and it also resulted in a crash.
It strikes me as a bug since I didn't have this issue in 4.18, though I guess I could just be using the node wrong?
asked Apr 04 '19 at 09:44 PM in Bug Reports
EDIT: If you just want a drop in solution that also works with BP only projects:
Thanks to this answers page I found the commit referencing a fix.
I've made a gist with the details, and example code over here.
Short answer with code:
This bug caught us out and I spent a while trying various solutions (deploying a custom engine build would be prohibitive for us)
This that I tried:
Hope this helps!
Since this issue was a big problem for us we did some further digging and found there was a commit in the master branch about 5 days ago titled "Speculative fix w.r.t. copy pose node": https://github.com/EpicGames/UnrealEngine/commit/c4ea32533ee98508ab68038488a09b3a12d54cd4
We cherry picked only the code changes from SkeletalMeshComponent.cpp for the moment and merged it into our custom engine build and it did indeed resolve our SetAnimInstance related crashes. Fingers crossed this fix makes it into the next 4.22 build!
answered Apr 06 '19 at 03:15 PM
This bug still not solved in 4.22.3. Can confirm it continues to happen in a blank, empty test project. The crash report appears to be happening on line 1554 of the SkeletalMeshComponent.cpp
So I figured out an alternative. When I don't want the animation blueprint playing, I use the Pause Anims bool set to false. Then I set it back to true when I want it to tick again. Working so far!
Follow this question
Once you sign in you will be able to subscribe for any updates here