‫Hello and welcome.
‫In this lecture, we're going to be introducing you to animations, how we can use the same animations
‫on multiple different types of meshes using something called a skeleton.
‫Let's dive in and see what all that's about.
‫So as I said at the end of last lecture, this is looking weird without any sort of animation.
‫So it's time to do a 101 on animations.
‫The first thing to do is to see if we can find some animations in an asset pack.
‫An easy way to do this is using the filters in the content browsers, which you've probably come across
‫before.
‫You can filter by all sorts of stuff here, and one of them is the all animation assets.
‫And just going to go ahead and check that is it adds in all of the animation assets and you can see
‫there is a bunch of stuff in here.
‫We're particularly looking for the green ones because these are basic animation sequences, as they're
‫called.
‫We can go ahead and double click on one of those and you can see it automatically starts playing in
‫the animation.
‫Editor There's a lot going on here and the animation editor But the main thing to see is this timeline.
‫That's the main difference.
‫We've also got the asset details, which is a details pane.
‫We've seen that sort of stuff before.
‫There's also this stuff up at the top, right, which we're going to dive into in just a second.
‫But the main thing to look out for is the fact it's looping through this timeline, which you can go
‫ahead and grab pointer.
‫Any keyframe in this timeline, if you like, you can play it forwards, you can play it backwards as
‫your heart desires.
‫You can step through frame by frame.
‫You can also use this asset browser over in the bottom right, and that asset browser just allows you
‫to search through all of the animations related to the skeleton.
‫Now I just used the word you probably don't know a skeleton.
‫What is it?
‫Well, we're dealing with a skeletal mesh.
‫Animations.
‫What is that?
‫That's a mesh that has, well, a skeleton.
‫It's a mesh that you want to manipulate through a bunch of bones.
‫So if we click up here in the top, right on the skeleton, you can see that this guy is in an A pose.
‫He is a mesh, but then he's got a bunch of different bones here.
‫We can select any one of these bones and we could do something like rotate it.
‫And you can see that that one wasn't a particularly useful one to select.
‫Maybe if I select with my mouse, the spine and I rotate the spine, you can see how that changes the
‫rest of the mesh based on changing the spine.
‫So great.
‫That's kind of what a skeleton is, but that's not all.
‫The skeleton kind of exists within the modeling program that was creating this mesh.
‫But a skeleton Unreal has a slightly different function.
‫So this skeleton asset here, its main function, is to tie together the meshes and animations.
‫You can have multiple meshes, which all use the same skeleton asset in Unreal and set multiple animations
‫that use the same skeleton.
‫And because of that, we can share those animation assets between different meshes.
‫The example here is the there are a couple of different Wraith meshes that I've included different skins
‫on that Wraith mesh, and some of them have extra bits and bobs on the mesh, but they can all use the
‫same animations because those animations are based on a skeleton that they all share.
‫So that's why we have this a little UI setup widget in the top, right?
‫We won't look at the blueprints just now.
‫That's another asset that depends upon the skeleton, but not one that we're currently interested in.
‫So the skeleton is what hangs all of this together, brings it all together.
‫They all depend upon that same skeleton, which means that this dropdown allows us to choose between
‫different meshes that use this skeleton.
‫And the dropdown next to animation allows us to choose different animations that rely upon this same
‫skeleton.
‫So I can go and swap out to a different animation.
‫I can swap out to a different mesh if I so choose.
‫And you can see how that mesh is different.
‫It's got different spiky bits.
‫It's got different textures on it.
‫So let's try out a challenge.
‫Let's see if we can find a suitable running animation that we can play just on a continuous loop.
‫At the moment, it'll look a little bit weird in the game.
‫Less weird than a guy running around in an oppose.
‫So look through the available animations using either the content browser or that browser.
‫Inside the animations editor set one for the Wraith character.
‫So go into our BP character that we've already created.
‫Go and find the mesh and see if you can find a way of setting the animation.
‫A little bit of a challenge there.
‫I haven't shown you how to do it, but see if you can find the right property for setting an animation
‫and then try swapping the Wraith character for a different mesh that has the same skeleton and see if
‫that continues to work.
‫Pause the video and have a go.
‫Okay.
‫Welcome back.
‫So let's see.
‫First of all, I need to find a run animation, so I'm going to do this via the asset browser.
‫In this editor, you could do it by either searching it through the asset browser or doing the dropdown
‫on the animations and searching there.
‫I'm going to look for run and interestingly enough, doesn't come up with anything automatically there.
‫So I'm going to search in the asset browser run not coming up.
‫Let's see, maybe there's a walk.
‫Let's see ability.
‫Let's see this one.
‫Maybe that's with the right mouse button held down.
‫So he's aiming.
‫That's probably a good one to start off with.
‫We want the forward one so we're going to hit play forward.
‫There's one for backwards left right.
‫You can see how this stuff is going to start slotting together.
‫Right now we're just doing a101 on skeletal animation.
‫So let's use this ability are be walk forward and let's go and find ourselves.
‫First of all, I'm going to cancel out this filter for animations, going to go and select our shooter
‫character and open up that blueprint, go to the mesh in the components hierarchy and then select the
‫in the details pane.
‫Down in the mesh setting, we've got different skeletal meshes that we could swap out.
‫And just to clarify, the skeletal meshes are the ones that have skeletons, the ones that are able
‫to deform themselves with a skeleton, whereas static meshes are the ones that can't deform the cells
‫usually used for rigid things like cars.
‫So in the section above this we have animation.
‫You can see this animation mode and animate class.
‫So we'd have to do a drop down on the animation mode if you had figured that out.
‫Don't worry if you didn't, but it was good to have a little look around.
‫Then you can see we can use animation asset in here and we can swap that animation asset out for what
‫was it, r, m b and then underscore walk, I believe there we go, walk forward.
‫And that's going to be on looping.
‫We're going to play it initially from the initial position of zero.
‫Let's try that out.
‫If we go to the viewport, you can see he's already doing that walking animation so I can go ahead and
‫play and he's going to be walking in my game as well.
‫And as long as I'm moving forward, that all looks hunky dory.
‫But as soon as I start moving backwards and sideways, it all falls apart.
‫We're going to fix that, don't worry.
‫But for starters, we've figured out how to do this.
‫The other thing we need to do is try with a different mesh.
‫So we've done it with the basic Wraith mesh.
‫There are other meshes in here, but they're not going to work because they're not based off the same
‫skeleton as the animation.
‫In fact, you can see it unselected the animation to play.
‫So if we go back to our mesh and change that out for the Wraith skeletal mesh, then go to our anim
‫and look for the walk again.
‫Walk forward, then swap out a mesh for one that has a compatible skeleton such as the Luna ops skeleton.
‫You can see it hasn't removed the animation because they share a skeleton, so they are compatible with
‫one another.
‫Awesome stuff.
‫So now hopefully you understand a little bit more about what an animation is, how you're able to play
‫it, and how it relates to skeletons and to skeletal meshes.
‫Next video will be a brief interlude on how to fix a little collision bug that we you may have seen
‫just glitching in the background there.
‫So I'll see you there.