How to Animate Your Character in Unreal Engine 5 - Animation Blueprints and Blendspaces

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up guys welcome to new Unreal Engine factorial and today I'm going to show you on how to animate your character basically we're going to go ahead and create an animation blueprint so it's gonna be a very easy video to follow so let's get started but first check out the link in the description to get out with some unreal ending courses on winfox alright so the first thing that we need is of course your character and all the animations now in my case I'm gonna be using this the normal default mannequin ones just to show you in the show how you can create an animation blueprint step but of course you can use your own character with your own animations and stuff and later on integrate them so the first thing I'm going to go ahead and create before the animation blueprint itself is going to be an animation blend space so race right click go to animation and now if we are in 5.1 you will see that we have an animation Blank Space over here the thing is that it will this will include uh two axes okay basically a virtual a vertical one and an horizontal one but for the purpose of this tutorial we are not gonna be making straight movement okay so we don't need like diagonal and backwards movement we'll need like an idle animation working animation and running animation um so we're gonna keep this simple so we're gonna go into Legacy and choose the blend space 1D of course if you're using like another version that is not 5.1 it will be available over here but anyway you're going to choose the best place 5.1 and then you're gonna go ahead and choose whatever character um you want your animations to be okay so actually I'm Gonna Change My Mind and go and select the Creator skeleton I just had it so I'm gonna be using in this video so let's go ahead and rename this so this I mean I'm just gonna put creditors then space I guess so let's go ahead and create this asset and now let's go ahead and open this up so you will see that we have a bit of like a timeline then we have the asset browser and details Etc so first of all this is going to be the horizontal axis so basically the blank space will allow us to transition between different animations very smoothly depending on the value that in our case it will be the speed so we can just go into the horizontal axis change the name to be into speed and now the maximum axis value will be basically the max speed of your character so in my case I'm going to put 500 which is normally what we have in a normal third person game and the minimum is going to be left at zero because well it will go from 0 to 500 okay I'm also going to tap snap to grid so it's a bit better and then in the asset browser that if you not see one of these windows you can just go into window here and you know open up as browser details whatever you need okay so we're gonna go ahead and find the Kratos idle well basically your character's idle and just drag it I'm gonna go ahead and place it on the left part so basically when the speed will be zero but then we can go and put the walk animation now the thing is that I don't have any run animation but if you were to have a running animation your Forge will put first of all the walk here and then finalize with the Run animation but in my case I just have directly The Walker so I'm just gonna play it at the end so maybe later I will have to change the speed of the character so it can match up a bit like a walking animation but we'll see for now it's gonna be cool so now if I hover over the timeline and hold Ctrl you will see how the character as the speed will increase will transition from the idle animation smoothly into the walking animation so this looks really cool so now we're gonna go ahead and integrate it into an animation blueprint so to do this we're going to do is just go here and right click go animation blueprint so now once again you have to select the skeleton for your character I'm going to go ahead and create and then we're going to do is just name this for creators and in Boop it so now let's go ahead and open this up and we will see that we'll have different windows and stuff so first of all we will have the name graph and here we'll be able to pass um you know different animations or slots and put them in an output output pose okay and then we'll have the event graph which basically will contain a mini blueprint for or animation blueprint so from here we can directly cast into our character and for example get the speed velocity the fs jumping if it's an error Etc all the conditions that we need in order to sensation in our anion graph so for us we're going to do right now is very simple we're gonna go we're gonna basically get our blend space and just put it on and now in my case I have two because I already had one from another tutorial about creators so let me see which one hit this basically this one what I want to do is just go ahead and just drag it from the counter browser because I know this one okay so now we have the plan space so what you can do is just directly pass it into the output pose now you'll see that if we compile it will be basically in our idle animation but if I were to change the speed to 500 which is the maximum one for example we can just compile again you'll see that now it will be with this walking animation but the thing is that we have to change the speed accordingly uh depending on what the speed on the cat on the player basically while we'll play the game so in order to do this we're going to just right click and promote this into a variable I'm gonna go ahead and cover press Q so it's all aligned and now we can go into the van graph so first of all we're gonna add another note which is going to be the initialize and then blueprint naturalized animation so this is like the big gameplay of the NM graph so here we're going to do is directly cast to the um BP third person character and then we're going to do is right click promote the Bible and it's going to be basically our character so we're gonna basically save our character in a variable so now in the update what to do is just get the character and then we can basically just get its velocity velocity there we go let's go down here you will see the velocity now the thing is that it will contain a vector now so we're going to do is say Vector length and this will basically convert it into a nice float so now we can just plug our speed here and then connect the length over here and now it will set up with our speed depending on our character in game so the thing left to do will be to go into the uh third person character blueprint so let's go ahead and open this guy up okay here we are and then what you have to do is go ahead select the mesh and change it into your um you know character so in my case it will be Kratos and this is huge so let me go ahead and just make it smaller there we go and then we'll go ahead and need our place our enemy class which will be our animation blueprint that we have just created so in my case I'm going to open the current browser and just dragging over here or I'm just gonna place it here there we go so now we have the animations for our creators and which looks really cool so now if I were to compile and press the game you'll see that I'm not moving so he's basically on his idle animation but when I started moving he will go into his walking animation now you can see that he's going very fast for his broken animation so that was basically what I anticipated so let's go ahead and select the character Moon component of course only if you don't have your running animation too like me or uh you know the speed doesn't match your animation you can just go into the max walk speed and you know just load this a lot so my guess is going to be 400 and I'm gonna go into the um into the bench space and just drag this here and then put 400. there are two and then to the end so now it should be a bit better maybe even too much yeah it's okay for now so you can see that we have our character already animating really cool now there's a few more things that we can add into our animation blueprint first of all if you want to play animation montages what you would need to do is add a default slot so a default slot will be basically the slot that the animation montages will be able to play if you don't have the according slot of your animation Montage in the animation blueprint just after the animation so it will basically be like over overwriting everything that's behind they will not be able to play now the number one is the default one so basically uh it's like you create a new animation Montage you will get the default so that's why we're gonna be using this one today so we can just compile and everything will be normal but if we were to play an animation Montage from the blueprint it will be able to play now I'm more thing that we can create is basically caches okay we can actually create caches and another thing that we can actually create is basically States and we're gonna select a state machine so here we can basically have like another mini event graph and handle a lot more of States so for example I can rename this to be basically the characters Locomotion so let me try to rename it back here so you can now go back and stop so rename there we go uh locomotion so now if I were to control X this and go into locomotion I could now go ahead and add a new state and then this will be the idle slash walk so then I could basically go ahead and enter this and place my creators Blank Space 1D over here so basically what this will do is just basically organize everything a bit better so now we have like a slot with The Locomotion and then it will basically output it in the exposed and stuff so now if we were to have like for example and crouching another crouch in blank space what you could do is I mean I don't have right now crouching animation but I'm gonna kind of create the blind space so you can understand screw gun for example I could just uh duplicate this and then you just put for example you know crouching and then I could basically go into the blank space just get the corruption land space Oh first of all I will need to create a new state or if you just drag it it will create another state but I prefer to do it manually so just put a new say crouching and then what you do you just open this drag the blank space in plug the speed variable over here and then if you go down over here then what you could do is just drag this and then put it into the other one so now basically you will have a transition and then the same we want to be able to go back into the walk so you can just go ahead and enter season back now the thing is that we need to put some conditions on this transition for example from idle to crouching we will need to create a Boolean which will be for example is crouching okay and then you will just place this one over here okay and set him so if it's crouching it will basically go from either to walk into crouching and then scratch into idle we need to open this and put in is crouching is nah Boolean so if it's not true it will basically go back into the uh you know the walking and stuff there space now you will need to go into the vein graph you know access the characters and you know animation that it has and the blue variable sorry that it has and then basically go ahead and set your scratching depending if your character is basically crouching and stuff with your code in inside your blueprint basically and then it should work dynamically basically depending on this uh the Transitions and stuff so that's pretty much it guys I hope that with this you kind of get a better understanding of how the animation blueprint works and Etc so if you enjoyed a video and found it helpful I really appreciate you could like the video and subscribe to my channel I have lots of Unreal Engine Parts tutorials available so if you want to check it out go ahead now yes without said bye bye foreign [Music]
Info
Channel: Gorka Games
Views: 330,058
Rating: undefined out of 5
Keywords: games, videojuegos, unreal engine, unreal engine 5, ue5, animation blueprint, tutorial, quixel, megascans, unreal engine animation blueprint, bp anim unreal engine 5, ue5 aim bp, ue5 blendspaces tutorial, ue5 how to animate your character, unreal engine 5 simple anim bp, unreal engine 5 easy animation blueprint, unreal engine 5 simple blendspace, unreal engine 5 how to add animations to a character, unreal engine 5 easy anim bp tutorial, ue5 simple anim bp tutorial, animations in ue5
Id: WUXvq6At6pE
Channel Id: undefined
Length: 11min 54sec (714 seconds)
Published: Wed Dec 28 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.