Play Animation not working

I have default player character, and which is affected by his health. On attaining zero health, he will die. I want to run animation on ‘0’ health

So i prepared a node function ‘playerdeath’ which i am able to call successfully, but the animation selected in the node is not working. Can you help me where i am doing wrong ??

Thanks

yes, animation is already added to BP. Please check this pic , but still not playing…

Oh Thanks, I was doing mistake , i attached it with event and which is getting executed with each time frame and thats why the animation was seems that not executing, i used ’ Do Once ’ and now its working… thanks for the help…

There are many ways to do this, but I will guess you have an animation bp for the character - if so you really should play the animation from the mentioned anim bp.

The animation bp is probably the reason your animation isnt playing, since its animations will probably override the animation you are playing. I haven tried playing animations directly from the character bp myself so - take that as a guess.

I would suggest setting up a slot for one shot animations in the state machine and play the animation in that, or create a blend node that holds the “dying” animation - try both so see what would work for you, it depends on how you want to handle the death blend etc, and your overall animation setup. But most likely you would want to use a blend node if your “death” animation is one single animation.

wiki info: Animation Blueprint Blend Nodes in Unreal Engine | Unreal Engine 5.2 Documentation

//gl hf