Got a weird issue here which I can’t figure out the reason for. I have created a really basic death animation for my character where they fall backwards. I want this to blend into a ragdoll once complete. I have wrapped it up in an Animation Montage. It has a single section which has an end, and it is set to loop just once. No anim notifies or anything.
However, the montage just loops endlessly and “On Completed” never triggers. I know the On Play Death event only triggers once because of the “Dead!” print to the screen, so it’s definitely a problems with the “Play Montage” node, or the Animation Montage itself.
NB: You may notice in the blueprint above that it’s trying to play a different montage “PreAimMontage”, I wanted to try ruling out a problem with my death montage by playing a different animation, but that one loops endlessly too. If I remove the connection to Play Montage and skip right to simulate bodies, then the character flops into a ragdoll right away as expected.
Hi , you could always use on Blend Out which will catch the animation when it’s blending to another state. Or alternatively, you can create an animation notifier on the frame you want a specific action to happen and then create an Animation Notify event and trigger whatever you want to happen.
Why I recommend not using the On Completed is that it doesn’t cross over well with what you’re trying to activate with the Set All Bodies Simulate Physics - might be a bug not sure, but the other two options above will definitely work.
In case someone finds this later down the line, the loop number is the default number of loops but if you set your section to loop indefinitely (teal color) then it will ignore that. Or more like it behaves differently but you get it probably.
In case anyone is still having trouble with this and for future solution seekers (like i was untill a minute ago). For C++/blueprint hybrid :
If you are playing your death animation from a anim montage and its looping then you can add a anim notify (for example: let’s name it DeathEnd) inside your anim montage towards the end of the death animation.
Inside the class that uses the death animation (for example a Enemy.h) create a
UFUNCTION(BlueprintCallable)
void DeathEnd();
with the function definition (inside Enemy.cpp) being:
This DeathEnd() function will be called inside of your Enemy_Animation_Blueprint (in Event Graph) by using AnimNotify_DeathEnd connected to DeathEnd() (the function we created with C++ and set to be BlueprintCallable). Ofc you need to set up some logic (either in C++ or Blueprints) on when you are going to call the “death” animation (which in turn will call the DeathEnd function via the AnimNotify) .
If you are not using AnimMontage and AnimNotifies, other ways are to use animation states, create a “DeathState”, set up some logic when to enter this state ( f.e. Health<=0) and click the “loop” box for your death animation to stop it from looping.
Also, the blueprint DoOnce might be useful (although i havent used it since i did my implementation in C++.
Hopefully this helps someone.
I also had this issue and found a solution in my case.
You shouldn’t put “play montage” node in event graph of characterBP, not animBP.
Timeline system doesn’t work in animBP, so play montage doesn’t work, either. (although you can find this node in animBP)
Hope this helps those who also encounters this issue.