Unreal Engine 5 Tutorial - Root Motion in Animation

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] thank you what's going on everybody James here from artificial entertainment and welcome to another Unreal Engine 5 tutorial and in today's tutorial we're going to be taking a look at the ways to apply root motion so let's go ahead and dive in so I have here a third person project that I've added in a few things just a simple animation blueprint a character for us to use as well as animations for us to be able to use with root Motion in them and the first thing that I want to talk about is how to be able to determine if an animation has root motion so what we're going to do is I'm going to go ahead and we're going to go into the asset pack here so for me I'm using the gurzem sword pack I don't know if I'm pronouncing that correctly I'm probably not but if we go into any of these movements here now you can see that we have a ton of different versions however some of them say in place so that tells me that these are the In-Place animations so if I click on for example this animation and if I go to the skeleton tree and click on root as you can see there's now a line being driven from when the character starts and where the character ends this tells me that there is root motion applied to this animation now generally if you buy a back in this root motion on one of them where it's supposed to be it's generally a good bet that all of them have it but if you need to you can always go through one by one however we're going to be doing this on retargeted animations so what we're going to do is now that we know that our base animations have root motion and I've already set up a retargeter here so we can go ahead and just open up the ik retargeter here that I've got and I'm going to choose one of these all combos because this is like multiple attacks all in once you can see like this one's got a ton of different attacks going all over the place and it actually has a lot of great Forward Motion now one thing also just to consider when you're doing retargeting and you want to keep root motion if you go to the chain mapping click on root make sure that the translation mode is set to globally scaled this will ensure that your root motion stays when you transfer all the animation data so now that we have our chosen animation here we're going to go ahead and just export the selected animation and I'll just put it right into my content folder so now if I minimize we'll see the animation here so I can open this up and if I go and I just know know double check to make sure that root motion is there we can see that root motion is still there which is awesome now but we want to be able to use this root motion when we actually have our character doing these attacks and making sure that it actually adjusts our character's position or our overall actor position with this animation's root motion track so all we really need to do is we're going to go to the asset details inside of the animation itself and we're going to scroll down until you see root motion and then enable root motion we're just going to click on this now as soon as you do you're going to see that the animation doesn't move anymore it looks like it's in place but don't worry that's just exactly what's supposed to happen so you didn't lose your root motion animation it's just changing how it's interpolating it because it's going to apply it when you put it inside of a montage or if you enable it inside of an animation blue and we're going to cover both of those today so but now that we have enable root motion checked and we have everything set up we can now go ahead and just right click on our animation go create and we're going to create in a montage and we'll just call this attack so now we can use this Montage inside of our our third person character so I'm just going to open up the character blueprint here and pull up the event graph then if we zoom in I'm just going to use keyboard event e so we'll take keyboard event Eve and I'll impressed we'll just go play and um Montage we'll use the simple one we don't need the one with all the extra end pieces and then the end of Montage we're going to play is going to be attack now if we compile and save and then just hit play if I hit e on the keyboard now you see the character is stepping moving forward each attack now I will say the animations are a little jerky um and I think that's just you know the way the animations are usually when I use these specific ones I have them playing a lot faster but as you can see root motion is applied so that's as simple as it gets when you're using room motion you just got to make sure that there's a root motion animation track and then when you export it make sure that you have the globally scaled selected for the interpolation and then from there you can just add it into your Montage now let's talk a little bit about when you want to use it in an animation blueprint though because there is a setting that you have to change to be able to ensure that it's actually going to work so I have a simple animation blueprint here that I've set up so if I go into my retargeting folder here and I just pull up the animation blueprint here this is the one that's running the characters right now and when you pull this up if you go up to class defaults you're going to see root motion as an option here under the details panel Now by default root motion from montages only is what it's set to however we can take the drop down here change it to root motion from everything and to prove to you that this works we're just going open up the state machine and I'm going to take that Greatsword attack but not the Montage version just the animation sequence version of it and then what we're going to do is pull off the entry we're going to make sure to add a state not just the animation into it and then we'll double click open up the state and we'll put this animation as just you know the base state that it's going to run all the time and now it's using a root motion animation so if I go ahead and hit play if I touch nothing on the keyboard as you can see it immediately starts playing and all the root motion is kept now one thing just to show you guys if you do not have that selected and you do not make sure to select root motion for everything under the class default of your animation blueprint this is what's going to happen so root motion from montages only we'll compile save minimize and then hit play now you can see that the character moves but the capsule does not the camera does not nothing moves except for the character mesh so the root motion does not actually get tracked the way it's supposed to but the second we make sure to set it to root motion from everything it'll now do exactly what we want it to do moving the character and the capsule component and the camera all at the same time so that's root motion guys it's very very simple the main thing is is that you have root motion data inside of the actual animation itself but I hope you guys enjoyed today's video we got a lot more coming out on just a dual apologize about the delay I know there hasn't been any new videos in almost a month now I just been working on a lot of stuff in the background but we're going to be putting out a lot more videos as time goes on so make sure to stay tuned and as always stay animated
Info
Channel: Artofficial Entertainment
Views: 12,303
Rating: undefined out of 5
Keywords: Unreal Engine 5, UE5, Tutorial, Root, Motion, Animation, Root Motion, Character Animation, Game Design, Game Dev, Unreal Engine
Id: vMEN3j6RLj0
Channel Id: undefined
Length: 6min 11sec (371 seconds)
Published: Wed May 03 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.