‫Hello and welcome.
‫In this lecture, we're going to introduce a new node called the Blend Poses by Boolean, which will
‫allow us to check a checkbox and kill off our character.
‫Let's dive in and see how it works.
‫Okay.
‫So we want to get our character to die when we reduce the health down to zero.
‫So the first place we're going to be looking at is an animation blueprint because that is the place
‫that we're playing our various animations and we want to switch over essentially from playing.
‫If we go over to our anim graph, we want to switch over from playing this blend space over into playing
‫a death animation and basically to never go back from there.
‫So the way we're going to do this is to use a new type of node called a blend by boolean.
‫So if we right click here and look for the different types of blend that we can get in here, I'm going
‫to scroll to the top.
‫There's a whole bunch of blend poses down here that it's selecting for me by default.
‫Don't know why, but if we do a blend poses by boolean, you can see quite clearly that we've got two
‫options here a true pose and a false pose.
‫So basically what we'd want to be doing is to play our BB's blend space locomotion animation when we
‫are not dead, and otherwise we want to play our dead animation as the true pose.
‫And then here we've got some options for how how quickly it's going to blend between the two animations
‫when the Boolean value changes.
‫Now, in our case, we're not going to have players resurrecting.
‫So the most likely case is that we're just going to hit that Boolean once and not go back.
‫So what do we need here?
‫We need a death animation.
‫So I'm going to right click and search for death and see if we can find a few ones here.
‫We've got a death backwards or death forward.
‫So let's just have a look at the differences between those by going to our animation view and we'll
‫look for death in there just to preview those animations.
‫So death backwards.
‫Let's have a look.
‫Let's do that again.
‫So, okay, it's being shot from behind and falling forward.
‫So it's kind of the opposite of what I would expect.
‫Death forward is probably the one we want.
‫Where are you being killed from in front?
‫I think that's what it's trying to say.
‫So let's go and open up the death forward.
‫There you go.
‫We kind of get shot and fall up backwards.
‫So that's the one I'm going to want.
‫I'm just going to dock my shooter animation blueprint to the main window.
‫And in here, we're going to look for death forward and we're going to play that through the true pose
‫and then hook up the output pin of the blend poses by bool to the output pose.
‫If we hit compile now you should see it's playing that BS locomotion.
‫If I hit the checkbox and recompile, you can see it is playing at death animation but note it's looping.
‫So one thing we can do here to prevent that is by selecting that node to play death forward, we can
‫uncheck the loop animation in our details pane over on the right and hit compile and now it should play
‫the death animation and then come to a rest at the end of it and stop, not go any further from there,
‫which is exactly what we want here.
‫It's time for your challenge to add a death boolean.
‫We've been controlling everything else via those variables on our animation blueprint.
‫It's time to add a variable to the blueprint for death and whether we are dead or not.
‫Set the blend based on this variable and then test it without compiling within the blueprint or compile
‫first.
‫But you won't have to recompile every time you flip the switch and you should be able to see it switch
‫between our death animation and our movement animation.
‫And with that information, you should be able to see whether the timings on that blend node are correct
‫or not.
‫So pause the video and have a go.
‫Okay.
‫Welcome back.
‫So hopefully this was fairly simple to do.
‫Let's go into the variables in the my blueprint pane.
‫Add a new variable.
‫It's automatically a boolean for me for some reason and I'm just going to have this as is dead.
‫And that's going to be the state that we're going to then grab from the character in the next lecture,
‫not in this lecture.
‫Going to drag this into our anim graph get is dead and then I'm going to hook it up to our active value
‫like so.
‫And now if we compile we should see is dead show up in the anim preview editor over on the right bottom
‫right and if I check the is dead checkbox then it goes ahead and switches from our locomotion to playing
‫our death animation.
‫Fantastic.
‫So that's what I wanted to achieve in this lecture.
‫And in the next lecture we're going to hook that up to the actual gameplay.