Hi all, I have set up a script that removes the players health over time resulting in a death animation, but instead of that animation being called, some gun holding animation gets called instead?
So it sounds more like your issue isn’t that it’s playing the wrong animation, but that your montage isn’t actually being played, so you’re state machine just keeps on going, since you haven’t passed it anything to designate a different state.
Setting the StateMachine comment aside, I’ve encountered the same thing you’re describing with montages. For my situation, the solution was to open the montage, and set the “Montage Group” to something appropriate. For you, I’d assume it to be the same as what I had to select; which was “DefaultGroup.FullBody”
Having the wrong group selected for your skeleton/animation Blueprint will cause the montages to technically “play”, but you won’t see anything being done with your character.
Regarding the comment about the StateMachine… you may want to add in a section in your “Update” event for your animation Blueprint to check some information from your character or Player state that can set a variable in your AnimBP like “IsAlive”
You can then use that variable to set your Locomotion graph to a “dead” state so it’s not trying to play idle, stand, whatever, animations on a dead character. There’s thousands of ways of going about it, so go with whatever suits your needs.
Also, on a side note… That Tick Event appears to belong to your Flaming object… I’d recommend not having that call your character’s Death function… Just have it do the damage (in your case, manual reduction of health).
And instead, in your Character’s Tick event; do your health check there (If Health <= 0 is true, call Death Function (or event if you decide later you need replication features for it)).
This will save you from having to maintain logic for calling of Death to the character on several objects if you have more than that one.
Thanks for the reply, I will try this out. I did try following this example: (https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/UseTimers/Blueprints/index.html)
However it left issues with the health bar display.