How to... Add Root Motion

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello and welcome to how to add root motion so do you have an animation that you have to use uh but you don't have it as a root motion and you want it to be root motioned well i'm going to go through and show you how you can add root motion to any animation inside of unreal engine 4. so here's my animation i'm going to use and a little charge attack where he charges his sword up and flies it forward i wanted to dart forward like a car almost like anime esque dash forwards so we're going to stop the animation and put the playhead right at start here and then we'll click on the skeleton tree on the left and choose the root bone with it selected go up top versus key and click new key now you can add keyframes to your animation so you'll see here you've got a root bone appearing here and this is an additive layer track meaning that any animation that's done on here is in addition to the current animation it was already doing so let's set this up first of all i need to set the keyframes for this thing so let's start here and add key again and then i'm going to move it along to where i want it to start moving and then i'm going to click add key again and then i'm going to move it forward the way i want it to start well be the end point of it so now i'm going to move that to where i want it to be and then add key again you'll see this little graph now is now showing this little change here so basically it looks like this and we can tweak this as much as we want as well by changing the graph here itself now if you want to change the graph a bit more a bit more control on it you can double click on it inside my curve here i can click on each one of these graphs here and it will show me the translation that's happening here now the moment we're just translating in the y axis so if i go through the y one this is the one that's doing all the work so when it goes forward it's doing that there i can customize this further by clicking and dragging each of these keys around on this track so i want it to start a bit later i can do by dragging it forwards and dragging it forwards there and i can fine-tune my animation for this all inside unreal right like that as it is there you can also make it so it's more curved rather than linear like this so if you want to do that if you click on this arrow here you can choose auto user set break linear constant you can see it's linear as the default one but you want to be more curved so that it's more less of an abrupt stop you can do the auto end there and you'll get like a little deceleration happening at the end here this works best when you've got two nodes set to both auto you can customize this further as needed okay you can customize this bit and turn these handles however you want refine tune your animation and there we have it we have added root motion to our character so to actually use it in our game we're going to go to the asset details and go down and choose enable group motion well first of all sorry let's hit apply hit apply at top and now apply this track to the root motion to the animation of the character then i'll enable root motion and hit save and that's now got root motion enabled on that character i then want to close this and i'm going to make this a montage let me go create a montage and this will be the charge attack and we want to use this one in our character's attack code i'm going to go into my character and i'm going to do the right mouse button so i'm going to do right mouse button and in here i'm going to drag out my mesh and tell it to play montage and the montage it's going to play it's going to be our charge attack so this is when i just push it when i release it i don't want it to cancel the montage if it is okay to do so so what i'm going to do here just make sure it works i'm just going to take the mesh out get the anime instance and i'm going to tell it to stop montage on stop plug it into released and we're going to choose our charge attack in the blend out time we'll put it as 0.2 hit compile and save that so now let's test this out in game so whilst i hold down that key he should go into the charge attack like that and obviously we can tweak this further with visual effects sound effects and so forth to sell the idea that this character is going super fast to do an attack and if i quit by letting go the mouse he'll stop his charge attack and there we have it if you like this and we'll see more how to's and other videos by me head over patreon.com forward slash ryan laylee where you can catch videos months before everyone else thanks very much for watching and i'll see you all next time bye everyone [Music] [Music] it's
Info
Channel: Ryan Laley
Views: 23,625
Rating: undefined out of 5
Keywords:
Id: rSMqX7LLIuM
Channel Id: undefined
Length: 6min 16sec (376 seconds)
Published: Tue Sep 14 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.