How To Make An Animation Blueprint In Unreal Engine 5.1 | How To Animate A Character - UE5 Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys and welcome back to another Unreal Engine 5 tutorial in today's video what can be going over is how to create an animation blueprint and blend space in Unreal Engine 5.1 and Beyond so this will allow us to animate our character and actually have it moving looking amazing so you can see on screen now what the end product is that we're going to make essentially just again character movement but we're not doing the movement specifically we're just doing the animations corresponding with that movement as the movements typically already set up for us but if it's not set up for you then click this link on screen now where you can watch a video to set that up yourself as well but without further Ado let's just get right into it starting with downloading a character and animations so you may already have some characters and animations you want to use if so great you can skip past this part of the video but if you don't I'm going to be going over getting some very very quickly now so the place I'm getting them from is mixmo.com it's an amazing website full of hundreds of free characters and animations you can use in your game so I'm in the characters section at the moment so I'm just going to scroll down and find a random one which I think looks good let's have a look at Castle god01 what does that one look like looks something like this well let's have a look at this one use this character I think I'm gonna go with this one here so once you've selected the character you want to use we can press download fbx binary t-pose and press download again then you just want to select the location you want to save in and then press save and then we're going to do the same thing for animations so go to animations except this time I'm not just going to scroll through them I'm going to instead search so I'm going to search for idle and let's see which ones we have here so let's have a look at this one what does this look like this one looks pretty good although the arms kind of clip through a little bit however we can increase the character arm space and that will look a lot better for us so you can see now we're then not going through as much but let me let's go with a different one instead I think this one looks pretty good too so we have a different kind of breathing Idol it's more kind of exaggerated on the idle itself so I'm going to press download and choose this one we want fbx binary without skin third difference a second and keyframe reduction the reason we want it without skin is because we don't need the skin as we have that on the character itself all we want from this is the animation data so including the skin will just increase the file size unnecessarily so let's download that and again put it into the file location which we want so next I want to get a walking animation so let's search for walk and let's have a look at what this one looks like and let's also make sure we tick in place so it's staying in the same place like this I think this one looks good but it doesn't kind of go with the theme of the character itself so let's have a look for some different ones I think this one maybe looks good let's again increase the character arm space maybe a little bit more just so he's definitely not clipping through his bag here obviously you don't want to get it too far because it doesn't look too great like that that's a little bit too far so it's lower it a tiny bit and it doesn't need to be perfect obviously but I think this animation looks pretty good so let's Again download this same as before it should have saved those settings and we'll just do the same process it's very repetitive you know what it is that you're doing next I want to get a running animation so let's search for run here and let's have a look at what fast run looks like again making sure to take in place this one looks pretty good I'm again going to just slightly modify the arm space a tiny bit I think that's all right and then let's Again download this and then the final thing I want to do is I want to get a jump animation however I don't want just a jump so if we search for jump what we don't want is we don't want something like this reason being is this will then continually Loop or just stop playing if the player is jumping for an extended period of time you can also notice there's a bit of a delay from when it actually jumps after the animation starts so we want to split this up into three we want jumping up falling idle and jumping down so you can see we already have some different ones here so jumping up is the first one I want and you can see it's from the same animation pretty much so let's download this then let's jump idle which I believe is actually called Falling idle here it is falling idle and we'll download that again and then the last one we want is jumping down which you can see we have already here like so again you can see these are all part of the same animation just split up into three now you can obviously do that manually as well if you want so you can get one animation and split it up into into three as well but if you do that just make sure all the animations are going to smoothly blend between each other and you can also of course just do one animation instead of the three which I'm doing here but the three just looks a lot better but once we've got all of our different animations and our character downloaded we want to import this into Unreal Engine 5.1 so let's go into unreal now and have a look how to do that so what we want to do is press control space to open our content browser and we want to just find some empty space so I'm going to right click create new folder and just name this characters or not characters I guess um let's just call it tutorial and spell it correctly ideally and let's open this up and then we'll just import our character and animations so firstly you want to import just the character by itself so don't drag anything else in just a character I'm going to leave all of this by default so tick sculptor mesh and tick import mesh and then we'll import all like so and you can do that by just dragging and dropping into the engine and let me just get this error message up here no errors it's just fxc loading found texture name Clash that's absolutely fine so we can just close that like so and then you can see we now have our character in here we can double click the pink one to open up the skeletal mesh and you can see the character here looking perfect so let's close that and then do the animations so I'm just going to do the same folder I'm not going to worry too much about organization so what we can do is just select all of the animations we have and drag and drop them in at the same time if the skeleton is in the folder it should automatically assign the correct skeleton if not open the drop down menu and find the skeleton you want and then leave everything else as default and press import all so now we're going to be importing in all of those animations perfectly like so so you see we have Swagger walk fast run jumping up falling idle jumping down and idle all of the different animations that we just downloaded so let's save all that perfectly like so now to start creating this into an animation blueprint that is very very simple what we need to do is right click go to animation and go to animation blueprint and then choose the skeleton we want for me that's this one so we'll select it and press create and then I'm going to name this one tutorial anim VP normally I do the name of my character and MBP but this doesn't have a name at least I could pronounce so I'm just going to call it tutorial and then we'll open it up straight away in here you can see we have an output pose what we're going to do is drag out the results and we're going to add a state machine like so and I'm just going to name this very simply Locomotion so that is what this is going to be doing and then we will double click that to open it up now you can see we have entry if we drag out of that we can do add State and a state is basically an animation that's going to be playing and so this one I will name idle walk run as we can create a blend space to do all those in one state out of this I'm going to add a state of jump up or start jump whatever you want to name it out of this we'll add another state of jump idle or falling idle and out of that it would add another state of jump down or jump land whatever you want to name it whatever makes most sense for you and it will connect jump down into idle walk run so we should now have a loop like this we're going from either walk run to jump up to jump Widow to jump down to either walk around you shouldn't be able to go any other way only like this as obviously that's the way that you would do it in real life if you were going to be doing these actions so that's perfect like so what we can do now is double click jump up and then we can now put in the animation so put jumping up like so and then we'll go to jump idle and do the same thing so that is falling idle for us connect that into there and then jump down we will then put in jumping down so essentially when this state is active it's going to be playing this animation and to make the state active we need to do something with these transitional rules here so that to go from either walk run to jump up this transitional rule has to be true so we can double click that to open it up and what do we think we're going to want to have a transitional rule B to go from idle walk run to jumping but we can simply stoop billion of is jumping so let's right click Canada transition promote a variable and name this is jumping or is falling whatever makes the most sense for you because this will be the same thing if the player Falls rather than jumps specifically it's still going to play this and then let's go back out of here because that's all we need to do so if is jumping is true it can enter it if it's false it can't enter it then for jump up to jump idle we just want to select it instead of double click it because going from jump up to jump idle we just want to do this automatically as soon as the jump up animation has finished so to do that we can select it and then just simply tick automatic rule based on the sequence player in state so we take that that's basically just a fancy way of saying when this animation finishes playing go on to the next state that's what that's doing there jump Idol to jump down we can double click that to open it up and this just wants to be if we're no longer jumping so let's get in is jumping here and out of this gets a not Boolean so if is jumping is not true we can then go into jump down and if it is true we're going to remain in the jump Idol State one thing we also want to do is go back into the jump out of state so double click it select Fallen idle or just our animation and we want to take Loop animation so for as long as the players in the air this animation is going to be continually playing and looping over and because it's obviously going to be a nice seamless Loop you won't be able to tell that it's looping so let's go back out of here and then jump down to idlewalk run we can select that and that again wants to be the automatic rule based on sequence player and state so as soon as this animation finishes it will go back to idle walk run it says compile and save that that is now Perfect all we need to do now is set up our idle War crime animations and also set this Boolean but let's do the animations first so if we open idle walk run you can see we haven't got the animations in here but what we can't do is we can't just get in idle Walk and Run and connect them in as we can only have one in at a time oh sorry Scott jumping down I meant Idol again we can't just do that what we need to do is create a blend space so let's open up our content browser right click go to animation go to Legacy and we want blend space 1D we're then going to select the skeleton we want and simply name this again the same name convention so for me tutorial anim BS for blend space and we'll open it up straight away in here it's very simple what we want to do so we want to have the access settings be horizontal axis open it up and have the name as speed the minimum value is going to be zero the maximum value is the maximum speed we're going to have for our player which for me I'm going to set as 600. you can set that as whatever you want but 600 is a value I like doing and then let's set the grid divisions to two for example so we have one at the start one in the middle one at the end and we're also going to take snap to grid and then let's change the smoothing time to 0.5 so it will take 0.5 seconds to blend from this animation to this animation to this animation so it just makes it look a lot smoother and a lot nicer and that's pretty much all we need to do except obviously we need to add in the animations as well so at the very beginning when the speed is zero we obviously want to be idle so let's just get in our idle animation here snap it on then in the middle when our speed is 300 we want to be walking so we get Swagger walk like so and at the end when our speed is 600 we want to be running so we get faster on like so now to actually preview what this is going to look like we're going to hold down left control and move our mouse cursor along here to see what it'll look like so this is our walk and this is our run and obviously this is our idle as well so we're going to be going through these different animations here and I think these animations actually look pretty good for the character we have as well so let's save that and we can close it again as that is all we need to do then simply drag in tutorial nmbs as you can see we have it here now and connect it into output animation pose now if we compile you can see our character in the top left is playing our idle animation as the speed is zero the speed is zero is because we haven't set it up here so to modify this speed in runtime based upon the player's actual speed we need this to be a variable so we can right click on speed promote a variable and simply keep this as the name of speed and if we go back to just our state machine here all of this is now set up and working perfectly for us all we need to do again is just set up the variables but the state machine itself is done so let's go to the event graph and start setting up those variables we only have two that is jumping and speed so this is going to be nice and simple what we can do is come out of tryget Pawn owner and we can get velocity so the velocity is going to be the speed of the player let's just move these down here out of get velocity we want to get Vector length so we're going to be turning the velocity Vector into a speed float that we can use and then let's just set speed to be that Vector length variable connecting this into event blueprint update animation which is essentially event tick so that is now going to work for us to be getting the speed of the player at runtime then to do is jumping we want to come out of try get Pawn owner and we want to get movement component like so out of movement components we're going to get is falling from the nav movement and a set is jumping to be that variable so again as I said it's going to do it whenever the player Falls so if they just walk off of a ledge it will still do this animation as well but you'll notice that is what you want that does make it look a lot better says compile and save that and this is now the whole animation blueprint and blend space setup and working perfectly for us so let's close this and then the last thing we need to do is assign this to our player so let's go back to where our player is so for me that's content third person blueprints BP third person character we'll go to the viewport and select our mesh we're going to change this from skm Quinn simple to be the mesh we want to use so I can't remember what that's exactly called so we'll just find it here it is this one for me here you see it's a good size 3D Collision as well and then animation mode use animation blueprint and in class being the one we just set up so for me that was tutorial anim BP you can see he's already idle perfectly like so so it's compile and save close this and hit play to test this out you can see we now have our idle animation playing like so and if it's a run it will probably play and if it's a walk sorry it will probably play The Run animation just because I forgot to set up one thing we just want to very quickly set up a sprinting system as well so let's open up our character blueprint go to character movement and then search for Max walk speed and by default we want to set this to 300 as that is the walk speed we set up in the blend space then let's right click get left shift keyboard events like so then we're going to get the character movement and out of pressed we're going to set max walk speed connecting that into pressed like so then out of released we want to have set max walk speed again but the Pressed we want to set to 600 or our sprinting speed and released set back to 300 or at walking speed so again I just did that very very quickly so if you don't understand that too much I do have other videos going to that more in depth where I also create stamina systems for those as well now you'll notice I'm still using the old input system in 5.1 it does still work however it's obviously not recommended to use so again this is just because I'm doing it very very quickly just for the purpose of the tutorial but if we close this hit play we have idle and now we are walking at this speed and now we're going to be running as well now the warp speed could do with being a little bit slower to be honest to match the animation a bit better so let's do that now let's set the walk speed to 150 for example and then going to character movement set it to 150 here as well and then we'll probably also need to do is go back into our blend space so tutorial here tutorial anime BS and then modify this here so if we give this three grid divisions we now have walking at 200 which will be perfectly fine so let's just lower this speed to 200 or actually let's give it four grid divisions this will now be at 150 perfectly like so so sorry if I'm kind of speeding through this a little bit I'm just doing minor modifications based upon the current animations I have if you do need any additional help with this feel free to message me on Discord at any time we now have a walk which you can see it looks a lot better with these animations for this speed and we have our run as well which I think is a good speed for it but this looks perfect and I think these animations really fit this character really well but I think that'll be it for this video as we've done everything we've want to do what we've done is we've imported a custom character into real engine 5.1 we've given him animations so we've got this nice idle animation here we've got a nice walking animation and we've also got a nice Running Animation all working perfectly like so oh and also I'm sorry I forgot we've got jump as well so if we jump up and jump down that doesn't look too perfect so let's have a look at why that's like that and the reason for this will likely just be the animations themselves are slightly slow so to fix this you can just change the animations or speed them up or whatever it is that you like so just for a little example let's just speed up this animation so let's set the rate scale to two see if that looks any better obviously you probably want to get different animations because they're not going to look perfect as you can see there but the whole system itself does work it's just the animations I've got aren't perfect and could do with being a little bit better or the speed of them or whatever so obviously use your own animations if you want or just spend a little bit more time than I did Finding proper animations because obviously I just kind of picked the first ones I found but the idol Walk and Run look perfect so thanks so much for watching this video I hope you enjoyed it and hope found it helpful and if you did please do make sure to like And subscribe down below it really does help me in the channel a lot so thanks so much for watching and I'll see in the next one [Music]
Info
Channel: Matt Aspland
Views: 36,517
Rating: undefined out of 5
Keywords: ue4, unreal engine 5, unreal engine, tutorial, ue5 tutorial, unreal engine 5 tutorial, how to make a game, how to, 3d modelling, blender, games design, ue5, animation, animations, blueprint, blendspace, idle, walk, run, jump, how to make, animation blueprint, ue5 animation, anim, anim bp, bp, bs, anim bs, smooth, transition, make, ue5 animation blueprint, run animations, walk to run, idle to walk, idle to, walk to, jump to, to, from, back, dynamic, speed, velocity, direction, updated, loop, moving, 5.1
Id: qbgDaRo312k
Channel Id: undefined
Length: 19min 14sec (1154 seconds)
Published: Sun Feb 19 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.