To control my death animations, I am going to use the State Machine to detect when the characters have died, then play the death animation.
Here is the code that destroys the character. This is triggered when the character's health hits 0 or below. The timeline is used to sink the body into the ground, so that it doesn't just disappear when it is destroyed.
This setup is almost identical for all my characters, including the player.
The only difference being, the player is able to re-spawn. This is done via an event in the Game Mode event graph.
And a system of Blueprint Checkpoints which update the re-spawn location when they are passed.
This makes it extremely efficient to place as many checkpoint re-spawns as required, anywhere in the level.


No comments:
Post a Comment