Stop AnimGraph ticking upon death

How can i force stopping the execution of the AnimGraph upon death? i have enabled ragdoll, but “Event Blueprint Update Animation” is still triggering every frame and trying to update animation variables, which are not needed anymore.

1 Like

Hi Arty-McLabin, If the mesh is not pending kill you could just set a Boolean Branch in the EventAnimUpdate, and flip it on your EventDeath, which would mitigate the updating . . . or you could hot-swap the meshes, take a pose snapshot and set a poseable mesh (?) to that transform, set the pose in that position and remove the skeletal mesh (which will remove its Anim BP updates). Let me know if that helps.

thanks for sharing your thoughts, however i would like to avoid this because the first will although improve but still eat performance by calling that tick event and branch every frame, and the second solution causes more problems to arise.

So, if there are hundreds on screen at once how long are these meshes present in ragdoll after death? If its only a short delay before they are destroyed, then its not worth worrying about, use the bool. If its a long delay or indefinite, you should swap out the actor for a dummy mesh, not sure what trouble you had there. You could try changing the characters assigned anim instance to null, it might end up in the reference pose . . . maybe.

You are really asking “is there a bool that disables the Event AnimUpdate”, as far as i know there is not. So you will have to add your own. Performance-wise, this is nothing.

1 Like

Events are not working on bool, instead - they use bind system to get called. every frame, the engine calls every registered tickevent. you can imagine it as an array of functions.
once some object is created, it’s tick events are binded (added to the array), and once it is destroyed - it is unbinded aka removed. you can manually bind and unbind it yourself and that’s exactly what i am looking for, not for a bool. because bool does not unbind, it just serves as a closed gate.

knocking on 1000 closed gates before reaching the opened ones is still a consuming thing.

1 Like

Yes, i understand :wink: Not in blueprints, as far as i know. Set the anim instance to null on death, all anim update ceases, ragdoll maintains just tested it in my multiplayer game, works fine.

1 Like

hmm. didn’t try setting to null. it does the job perfectly!
can you transfer this comment to a separate answer so i will accept it?

1 Like

On Health <1, death - you can:

GetMesh → SetAnimationMode [custom].

This is simplest solution for bp I think. I have it a little expanded, because I have “physical, ragdoll death”, but anyway it can stop animation blueprint, no more tick on it. Generally it will set mesh to T pose, but with some additional setup it works simple and perfect.

I use this method, because I need still access to ai inventory for example and some it specific features (weapon used, skin etc) so spawning mesh with snapshot pose is no go in my case, but just stop animation blueprint what is a little heavy - is enough.

2 Likes

AnimGraph is still ticking even if you use a ragdoll death (which i use as well).
as mentioned above - just setting anim instance to null works great.

1 Like

This is set to null. With SetAnimMode [custom] without “custom” value is null. If you have different node to set null - show please, but my anim not tick for sure - I have debug and print string.

1 Like

as far as i remember, just search “set anim instance” in the skeletal mesh, with empty input. it should be a variable in the skeletal mesh. can’t check for sure because my GPU is dead and i cant open UE4

1 Like

You will set empty animation bp, where SetAnimMode disabling anim bp. Generally this is same, but my version looks more kosher, but what I know?

1 Like

are you sure SetAnimMode will free the memory? it could just disable the anim BP without freeing the memory from RAM. as long as it will free, who cares what version to use lol

2 Likes

Hey there. Maybe a little late, but just to clarify. The Garbage Collection System will clear the memory when the AnimBP can no longer be reached through a reference. Even if it does not free when changing anim mode, it will when the character is destroyed

1 Like

your claim sounds completely logical. probably that’s correct, thanks for noting.

can you please remove the duplicate answer?

I am setting Pause Anims bool on the Skeletal mesh component to true, I checked the animBP and it is not ticking anymore. I’m sure this isn’t the lightest weight solution cause the animBP is still in memory but it’s the best solution if you are not using ragdolls since it will maintain the last pose

Also setting the Skeletal Mesh Component Tick to null will do

what do you mean? is my solution a duplicate? or is the problem my comment underneath my answer?

Oh just noticed I double posted