♪♪♪
(Wes Bunn) All right, so we are back. In the previous video, we finished up inside our
Character Blueprint for the moment in terms of setting up our controls so our Character
can run around, he can jump. We can do that with the mouse and keyboard, the gamepad,
and touch controls now. In this video, we are going to talk a little bit about Animation Montage
before we jump back into the editor. The reason that we wanted to talk about Animation Montages
for just a second is this is the system that we are going to be using for our punching
sequence so that our Character can punch. I thought it was a good opportunity to kind
of break down how they are used and what they can do. I guess in short though, the purpose
of an Animation Montage is to allow you to combine animations. That is really only the
first part because that in and of itself is not really all that special. There are other
ways you can do that in Unreal Engine 4. But you can then section off those animations
within the Montage and then play animations selectively from that Montage. You can also
do things like fire off Events. You can essentially use Montages as a way to take an entire group
of related animations and make them into a single unit and then within that unit, you can
choose exactly what is happening at a given time. Now probably the best usage cases for
an Animation Montage would be special animations, one-off things. A really good example would
be like reloading a shotgun. I am sure you have all played that game where you had a
character that had to reload his shotgun. If it is an 8-round shotgun, they will break
the thing down and start ramming in the shells. So he is like, "1, 2, 3, 4,..." and keeps
reloading the shotgun over and over again. Doing that as a Montage in Unreal Engine 4,
well the way that you would start doing that is you would have one animation that would
be breaking open the shotgun. Then, you would have another single animation that would be
loading a shell, and then have another animation of closing the gun. The way that
the Montage would pull this off is it would immediately start playing and your character
would begin breaking down the shotgun. Then they would start loading in that first shell,
but then you could loop this section of the animation. You could keep looping the loading
the shell aspect as many times as you needed to. This could actually be based on game logic.
So if you are only 4 rounds down, you could loop that loading animation just 4 times.
There could actually be a check like based off of an Event or a Branch Point, which we
will talk more about a little bit later. You can actually then make sure that the gun is
full. If it is, then you can move on to the next animation and close up the gun. Now,
what we are going to do instead is a little bit different. We are setting up punches,
as you know. Our punching system is going to be broken up into 5 parts. We will have
a Punch Start, we will have a Left Punch, we will have a Right Punch, but then we will
also have a Left Punch End, and a Right Punch End. Now the reason that we are going to have
two different endings is for each of the hands that the Character could be punching with.
So imagine yourself punching a heavy bag. You are throwing a right-handed punch and
then you suddenly stop punching. You would need an animation to go from the right hand
back to an idle position. But for throwing a left-handed punch, you would need a different
motion to go from the left punch back to the idle. So that is why we have two different
animations for ending our punch. The way that our system is going to work is that as soon
as the Mouse Button is held down, we are going to start playing the Punch Start. Then as
soon as that part of the animation is done, it will immediately start firing off our Left
Punch. Once that is done, it will try to move on to the Right Punch. When it is done with
the Right Punch, it is going to loop back and try to play the Left Punch again. Then,
it will loop back and try to play the Right Punch again, and so on and so on. You could
literally sit there as long as the Mouse Button is held down and continue punching left, right,
left, right, over and over again. The keyword that was slipped into those last two statements,
however, is that it will try to play the next punch. That is kind of where these Events
will come into play. Essentially, what we are going to constantly be asking each time
we throw a punch is before I continue on to the next punch, is the player still holding
down the Left Mouse Button (LMB) to punch? If they are, then we will keep punching. But as soon as
that answer comes back as no the player is not holding down LMB anymore,
then we will say, okay, which hand were they punching with? Let's play the appropriate
animation to stop punching. Then, we will be done with our Animation Montage.
So that is kind of what the Animation Montage is going to do for us. Internally, the way
that some people like to describe it is it is kind of like being an animation DJ. So
there you are on the 1s and 2s and it is a party of some sort. There appears to be music.
The way it works is you could start playing a Montage and then based off various game
events or game logic essentially, you can queue up what the next animation is. Or like
with the DJ example, what the next song is going to be. You could play that, or you could
stop playing altogether. You can jump to any part of the Montage that you need to, so it
is kind of like having turntables. You have a lot of control over what is going to happen
next as you are animating your Characters. Now, there are some other things that Montages
can do as well that we are not necessarily going to be exploring in this video series.
It has its own set of Notifies, Curves, and Tracks. We will get into Notifies a little
bit later; that is what we used for the Particle Effect that appears when running around
as you saw in the introduction video to this series. Curves and Tracks, which can be used for layer
additive animations, etc. are a bit outside of our scope, so we are not going to be exploring
those in this series. Maybe we will save that for another video down the road. So I guess
that is actually it. This is going to be a short video. I kind of wanted to just touch
on Animation Montages before we start working with them. So we will pause here. Just a heads
up again though, really quickly. The animations that we are going to be using for our punching
sequence are not really intended to be used this way. (Laughter) So don't expect things to come back
looking amazing, but you will see the process of how to create an Animation Montage
and how you can apply that to your own game as well. So with that, let's pause here. We
will pick it up in the next video where we will begin setting up our Animation Montage
as well as take a look at Skeleton retargeting to fix up our Character's animations and finally
fix our Character's dislocated arm. (Laughter) So let's pause. Thanks for tuning in and we
will see you in the next video.
♪♪♪