Using Root Motion In Godot 4!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys this is Mitch with Fine Place CGI and today we're going to talk about how to use root motion inside of Godot so we're basically going to rebuild our 3D character controller from the ground up but with root motion enabled so we're going to go through the process of getting our animations from miximo and converting them into being able to be used for root motion we're going to rebuild out our character controller we're going to recode the entire thing and reset up our state machine and set up all of our root motion stuff we're also going to go through and create a quick camera controller and we're going to talk about how to handle it so when your character is not looking at your camera how do we handle that how do we actually rotate our character in code based off of the direction of our camera so that's what I have a store for you guys today [Music] okay so the first thing that we need to do is we need to actually get a hold of our animations when you're doing root motion you actually are using the animation to actually move your character so you're going to need animations to kind of work with so that you can actually do the root motion so what we'll do is we'll come over to miximo which I don't know if you guys have ever seen miximo uh I have talked about it in previous tutorials as an awesome resource for us to create 3D characters because they offer free animations for us to use and that's something that is nowhere else in the industry so it's really cool to see and it's really useful and of course if you guys know of anywhere else that does this and actually gives away free resources for animations then please let me know because I'd love to promote their content now let's click login and then let's log in now in my case I'm going to log in with my Google account so I'm going to skip this part so you guys don't have to see that all right once we're logged in you can see that we have a bunch of animations over here on the left now if you are coming from my character controller tutorial just skip this whole section you should already have some animations downloaded just go to the next section now what this does is miximo allows us to have lots of characters like this and they also allow us to have lots of animations that we get to have for free now in my case it already remembered the character I was using but if you just go into characters you can pick a character and then go into animations and then let's pick an animation now what I'm going to do is I'm going to pull down the basic movement pack so there's actually a pack called I believe it's a movement I know how to spell if I type mail that might come up as well mail Locomotion pack now if you want the female Locomotion pack you can use that one as well I'm going to use the mail Locomotion pack just because I have a male character here so we'll just do that you can see here's the actual emotions that they have which can be quite useful it might be missing a few uh looks like it has them all okay so I think we're good it's just really hard for me to see um what it's looking at because the character just runs off into the distance they're way over here um so what we'll do is we'll click download and you will see that we have some download stuff so we have a fbx binary t-pose frames per second and keyframe reduction now in my case I'm going to pull down the fbx that's fine T pose that's also fine and 30 frames per second is totally fine we'll just do it all by default if you change any of these values it can change how your animations are perceived so that's something to keep in mind now we'll click download and we'll let that pull down we will click save and we will save it now once we have it saved we can basically just open it up and you can see we have a bunch of animations here now I'm going to go into my downloads I'm going to right click I am going to extract it and click extract and there we go now we have a bunch of these animations now previously I just had you guys open up blender and I just had you guys import the animations and then just export them out but since this is root motion it's totally different so if we come in here we go to file import fbx and we import a single fbx from our downloads so let's grab something like our walking animation right here if we move this forward you'll see that our character walks forward and that's basically what root motion is for right it's supposed to allow us to walk our characters forward based off of actual bone movements but something that people don't tell you is when you do root motion you need to have a bone called your root bone and a lot of times people use the hips right here to actually create your root bone but with Godot it gets kind of finicky because the root bone rotates and when the root bone rotates that really messes with the actual root motion of Godot so to mitigate that there's an add-on called miximo root now I forked this from Richard Perry who forked it from another person if I remember correctly John Goss right here was the original Creator so Props to him for creating this two years ago and then Richard Perry kind of picked it up and started maintaining it and then I had some crashing issues so I went through and created a PR for that so if it's not merged use my version if it is merged then use his version because it's always good to use the Creator's version now we're going to to click code and we're going to download a zip what this is going to do is it's going to allow us to have an add-on that will automatically create our root bone for us and that's what we need so if we were to import this into Godot the character would wobble side to side like this because when you look at this bone you'll see that as the person takes their step right here they actually rotate their bone you can see that bone get moved slightly to the side so the whole character would rotate like this constantly and we can't have that so that's what this add-on aims to resolve so if we create a new blender and we don't save our file we hit Ctrl a x delete we go to edit we go to preferences and then we come in here and we install and we navigate to our miximoroot.main install that add-on and then enable it once we do that if we hit n you can see we have a miximo tab right here we can open that up right here and you will see that we have all sorts of options now pretty much I don't use any of these options other than insert root and our source directory the rest of this means nothing to me pretty much so um you can remove prefects if you want to get rid of miximo rig you can delete the armatures and that will basically allow you to go in and say I already have an Armature I just want the animations um but in my case I'm going to have both of these guys because I like to do it a little bit more manual way gives me a little bit more control so what I'll do is I'm going to set my source directory I'm going to click on this little file icon and I'm going to go to root and I'm going to go to downloads mail Locomotion pack and you'll see I have a bunch of fbxs here so what I'll do is I'll hit accept and I will import my animations and now what it's going to do is it's going to batch go in and import all of my animations now if we look at that original Walking animation which I believe is right here you will see that now there's a bone down there and that's the big thing that we're looking for for our root motion is to have that actual root bone to exist because it has to inform us on where the character needs to go now once we have this I'm going to select all of my armatures except for this one right here so this little t-pose one Armature number two with this little mesh icon we'll just grab all the other armatures that's not this one and we will delete them and then pretty much the rest of this is useless to us once we have this all we have to do is go into our animation tab click on dope sheet change it to action editor and then select different actions as soon as we select our Armature here so then we can select different animations and you'll see that we have jumping we have strafing we have walking things like that so it already has all of our stuff basically set up for us now all you have to do is just export this so if I click on my Armature file export as a gltf now if you have blender support enabled on Godot you can just export it out and you're golden you're good to go now when we want to export our stuff we need to have a Godot project now I've already created one which is just an empty project it's called root motion tutorial it's right here so I'm going to open that up and I'm just going to put character Dot glb and I will export that guy out we're going to let that think for a second and as soon as it finishes we can go into Godot and Godot is going to import it now we're basically 90 of the way there now something that we have to do is we have to actually set up our import settings for this character so what we can do is we can double click on our character and you'll see it created a gigantic box here there we go and what we'll do is we'll come into our our scene we'll change our root type to a character like that and then we'll come down here and we'll go into our animations here our animations need to Loop we can't have them not Loop or else it's just going to basically take a step forward and then stop and we can't have that so we need to actually loop our animation so we'll click on idle and we'll say linear so the way the different Loop modes work is basically you have none which does no looping linear which will Loop it over and over so it'll go from frame 0 to the end frame so let's say 100 and then it will go back to zero and then go to 100 and go back to zero ping pong on the other hand Works kind of like a game of ping pong the animation goes from 0 to 100 and then it goes from a hundred to zero so if you have an animation that you need it to kind of wave back and forth like a flag or something like that then ping pong is the animation that you're looking for but in my case I'm going to set this to linear and then we'll go to our left strafe we'll set that to linear we're going to do left strafe walking linear right strafe linear right strafe walking linear standard run linear and walking linear and that should be pretty much all of this so we're going to click re-import and it's going to take a dough a second to think about it but it's going to re-import it and then we're going to right click our character and we are going to create a new inherited scene and here is our character so now if we click on our animation player you can see if we choose for instance a walk animation and we hit play you will see that our character is walking which is awesome right so that's great but our character is walking forward and I don't really want my character walk physically forward I want them to walk with root motion so how do we do that well to do root motion you need to have an animation tree node so we're going to right click our character add a child node and add in an animation tree node and then we're going to come over here select animation player and pick our animation player like so we're going to click OK and then we're going to change our tree root to a state machine and the reason why I'm choosing a state machine is because I prefer a state machine if you have a different one that you want to use you can use that one it's not going to affect the root motion at all now we can select our root motion which is right here if we click on a track and we click assign we can assign our actual root motion bone which in our case is our miximo root bone so we'll click ok and now our root motion should just work so now we can just hit right click add animation let's add a walking animation and let's just drag this transition into here and then let's click on our animation tree and click active and you will see that our character is now walking which is awesome right kind of how do we know our character is walking forward and how do we know if they're actually you know doing anything well what we can do is we can add in what's called a root motion viewer so if we right click our character add a child node and type root you can see we have a root motion viewer we can hit enter and we can set our animation path to our animation tree and hit OK and that is how you know that our root motion is successful so awesome this means that we're pretty much good to go we're ready to actually build out our characters entire system and it's going to be really quick because what I'm going to do is I'm going to come into my animation tree and I'm going to actually set it up so that way we can set this up really fast so what I'll do is I'm going to get rid of our walking animation I'm going to right click add in a blend space 2D I'm going to right click add an animation add an idle and I'm going to grab this guy I'm going to drag it to my idle I'm going to drag it up to my blend space I'm going to drag it back down to my idle and you'll see our characters kind of freaking out now why is that well what this is doing is it's because it's transitioning instantly if we come over here and we click on this guy right here we can go into our switch go into our Advanced and just change condition to moving like that and we can click on this guy and do the same thing we could just say idle now if you want more information about all of this go check out my 3D character controller for Godot 4 video and check that out because I go into actual in depth on how all this works and why it works and things like that but I don't really want this tutorial to be four hours long so I'm just gonna set this up real quick for you so what we'll do is we'll click on our pencil icon right here and you'll see that we have a blending shape like this I could just click on my little pencil and I can click down here like so add animation and I will add in Walking then I will click down here add animation standard run I will click over here add animation left strafe and I will click over here add animation left strafe now I think I might have the wrong animation so if I click on this guy and I click right here that's left straight this is left strafe walking so let's flip those guys like so and then I will right click right here add animation right strafe walking right click add animation right strafe I'll click up here add animation and we'll do a walking animation and I'll pull this guy to probably about I don't know about here ish and instead of doing a walking animation I'm gonna make it play mode backwards so our character is walking backwards so now if we click on this guy and we go to our root and we hit play you'll see our characters kind of acting really funky but that's because of this guy right here if we drag this guy forward you'll see that we are now walking if we drag it Forward further we are now running if we drag this backwards you'll see our characters walking backwards if we turn this to the left our character goes to the left and if we turn this to the right our character goes to the right easy enough and that's basically how we can actually set up our character's animation now we need to add in collisions so we'll come up to our character we're going to right click it add in a child known add in a collision shape 3D will come in here we'll make it into a capsule shape and we'll just drag it up so it matches our player once we have that we basically just need to create our camera so I'm going to hit Ctrl s I'm going to save this as character.tscn and then I'm gonna come into my and then I'm gonna create a new scene so scene new scene and this is going to be our test scene we're gonna go to 3D scene right click add in a child node add in a mesh instance 3D we're gonna add in a box mesh and I'm going to scale this guy down and scale this guy up so that way we have some kind of scene to work with I'm going to right click add another child don't added a static body 3D I'm going to right click add another child node I'm going to add in a collision shape 3D and we will make that into a box shape now all of this stuff is not necessary for you to do the rest of this tutorial but it's useful for us to do our testing so we'll drag this guy out like that and make it nice and big and then we will drag our character.tscn into our node 3D scene just like that simple enough and I'll drag this guy down so that way it's not quite there we go we should probably make this just a touch bigger there we are now once we have this we need to set up our camera and I've already gone through how to do this in the third person character controller tutorial so I'm going to run through this super duper quick and have it build out so first things first we're going to right click on our node 2D we're going to add in a node 3D we're going to right click add a child node add in a spring arm 3D and then we're going to right click that spring arm and we're going to add in a camera 3D I'm going to bring this camera out something like this I'm going to bring my spring arm up somewhere like this and actually I'll probably reset this guy to zero there we go and we'll pull this back to something like that so that way we have ourselves a location that our character can actually look at now I'm going to right click my node 3D I'm going to attach a script and I'm just going to call it camera controller and we are going to come in here and do a quick five second camera controller so we'll come in here we'll type Global position is equal to and we need to get access to our character so what I'm going to do is I'm going to click on my character I'm going to go to node I'm going to go to groups and I'm going to add this character to the character group I'm going to copy it like so and I'm going to say get tree dot get nodes in Group quote character I'm going to pull back that first instance dot global underscore position and there we go and then I need to make it so we can actually rotate our camera left and right when we move around so what I'm going to do is I'm going to say funk underscore input event and I'm just going to say if event is input event Mouse motion then we will say rotation is equal to Vector 3 clamp rotation dot x minus event Dot relative dot y divided by one thousand multiplied by some kind of sensitivity value so we need some kind of sensitivity value to determine how much we want to rotate when the user rotates their Mouse so what we'll do is we'll come up here and we'll say at export VAR sensitivity and then we'll come over here and we'll say sensitivity comma minus one comma 0.25 F and in my testing that's been a pretty decent number for what it's worth and then we'll hit comma let me take a look at this real quick so Vector three clamp blah blah blah so that should work that'll get back our first yep that'll get back our first one and then we can just come in here and say rotation dot y minus our motion Dot relative dot x divided by one thousand multiplied by sensitivity comma zero and it's upset because we have an F here because I'm used to C sharp so if we get rid of that hopefully that will fix it cannot use Simple annotation without uh type initializer that's because we're not telling it to be an integer type so we'll do that and that'll fix that in identifier motion is not declared and that's because this should be instead a vent not motion so we'll do that and that should do it now if I control S I will put this as test scene like that and we're going to need to set our sensitivity to something so we'll set this equal to something like five like that and then if we hit play you will see that we can now rotate our camera which is awesome now we do have some problems here first one being we are way too close to our character if we go to our spring arm we can actually adjust this to something like five and that will help with that so you can see now we are far enough away that it should be okay relatively we also need to set it up so that we're not snapping into our character and I think the reason for that my guess would be if I take a look at my test scene here and I look at my spring arm I think my spring arm is colliding with my character so let's change this to a collision mask of three so that way it's not colliding with our player that means that our floor will also need to be on collision layer of three so that way it doesn't collide with it or so that way it does collide with it and if we hit Ctrl s and if we want to solve that issue with it not capturing our Mouse we can just come in here to our ready and say input dot mouse mode and we'll put that equal to input Mouse mode captured and that will capture our Mouse so now if we hit play there we go we have ourselves a very basic camera controller now like I said if you want to go more in depth on why or how or things like that go check out my 3D character controller because that kind of goes over all of this in in way more detail now we need to actually code out our character controller so let's go to our character controller scene let's right click our character and attach a script and we're just going to call it character.gd that's fine so we will add that in and it actually has a pre-built setup for us unfortunately most of it's not going to be super useful to us because we're going to need to actually hand build a lot of this because we're going to be doing a lot of changes to how we're actually handling our logic here so what I'll do is first we'll set up our character doing root motion and we'll actually set up our animation tree stuff so we have our animation tree right here and we have our uh movement variables set up what we need to do is we need to basically say hey when we move our character it's basically going to set a variable inside of our animation tree to say that we're moving now we have a whole thing here where we actually kind of do that here so we get an input direct Direction and then we get a direction here which is a transform basis and then we kind of go from there now you could just basically come in here and say dollar sign animation tree dot set and then we can basically just set our movement equal to basically if our Direction does not equal vector three dot zero and then we could do the same thing but instead for our idle and just say if it does equal vector 3.0 and that basically if we hit play on our test scene so I'm just going to hit play select my current scene and that'll do that you'll see a our character just fell into the ground so that's not a good sign so let's see what's going on there our character is not actually in the ground so he shouldn't have fallen into the ground as my static body we refresh this yeah interesting we're falling into the ground so that's never good I drag this into here just to see our static body has an exclamation point so my guess is it's because my static body probably needs to be reset to zero or I guess to one and one and then set this to one well we'll have to unhook here one and one and then change our mesh size up to something large like so and then grab our Collision shape and you can see our Collision shape is actually below the ground so that's probably why I was probably just moving way too fast for it to be a good idea and I'm going to expand this guy out something like this we'll take a look see what happens we'll line this guy up there we go now if we refresh let's see if that fixes our problem there we go now if we hit forward backwards you'll see that the character actually moves forward and backwards which is pretty good now you'll notice that as we do our movements a this ways forward this ways backwards you can see he's not going based off of camera Direction you'll also notice that we're not actually doing it the proper animation either and the reason why is because when we do our Movement we need to actually set our blend shapes parameter to the correct value so what I'll come in here I'll just say dollar sign animationtree dot set like this and I will set my blend shape 2D blend position equal to my Direction and then we'll hit Ctrl s we'll refresh this guy and let's take a look so if we hit backwards forwards left right you'll notice that it looks like it's going backwards so let's try doing minus Direction we'll refresh that and there you go now we are running into some slight issues with our y direction and my guess is that it has to do with potentially the if I change this to input Direction what happens real quick and there we go so you see we're going backwards so if we were to aim it you know semi properly so once we have our minus input dur our our animations are playing we actually need to set up our root motion right now we're going off of our characters moving slide here off of basically a direction multiplied by speed and we don't want to do that we actually want to handle it based off of our actual characters movement based off of their actual feet movement so this is where things will get kinda funky now what we have to do is we basically need to get our rotation so we can come in here and say far current rotation is equal to transform dot basis dot get rotation quintinion and then we could just say VAR velocity is equal to current rotation dot normalized multiplied by our dollar sign animation tree dot get root motion position like that and that'll set our velocity based off of where we actually are walking so if we were to take all of this section where we're setting our velocity and we were to comment that out which I believe is control k for comment then we can basically just refresh this and in theory this should work we should be able to play our game now we have an invalid get index on base nil that's because our velocity does not exist and that's because we're setting a velocity parameter here instead of just setting it because I forgot that um the root version of a character node actually has velocity declared so I was overwriting it so let's try that now if we press forward you'll see that our character well they don't really do anything and I think our um controls are backwards at least it seems like it's backwards so we'll have to see what's going on with that but you'll notice that well frankly we're not moving right so what's going on with that when we do this we're getting back a value but we're not getting a value over time so we need to divide this value by our Delta and we'll have to come to the front and then set this guy like this and that will set up our velocity to be proper so now if we hit refresh you'll see if I hit back our character moves forward if I hit backwards our character moves backwards so you can see that it actually moves physically our character is moving the correct speed if we hit left or I guess right in my case our character will move to the left if we hit right our character moves to the right and you can see how it works it actually is a physical movement it's no longer constrained to a speed value it's based off of our actual animations speed value and that's the power of root motion so now I know what you might be asking okay so how can I translate this into a somewhat like a character controller well we already have our Mouse motion which is awesome all we really need is to make it so that our character will rotate based off of the camera position right because currently it's static right they go forward backward Left Right based off of the global position that they're in not based off of their local position well to do that it's actually quite simple we'll come up to the top up here and we will set a variable called horizontal rotation or camera rotation so we'll say VAR h underscore rotation is equal to and we're gonna have to get a hold of our camera controller now I don't have access to my camera controller so what I'll do is I'll click on my node 3D we'll go into node groups and we'll type camera controller like that we'll copy this and we'll just say get get tree dot get nodes in Group quote paste camera controller we'll pull back the first instance of it and we'll pull back its Global underscore transform dot basis dot get underscore Euler and we'll pull back our why on that now hopefully I spelled all that correct because we didn't really get any um Auto completion there so I'm kind of flying by the seat of my pants here but hopefully that will work and then all we have to do is we need to take this H rotation and we basically need to change our Direction based off of that value and what I'll do is I'll come in here I'll get rid of these input directions like so I'm going to come down here and I'm going to say VAR direction is equal to a vector 3 input dot get action strength and we'll pull back our left first so we'll type left for UI left minus our input dot get action strength quote right for you I write comma zero comma and then we have to get our other section as well so we have to get our Z Direction which is basically going to be the exact same thing as this except for it's going to be up and down so we'll grab this and we will say up for UI up providing that UI up exists it does it's just at the bottom UI up and then down for UI down and then all we have to do is set up our direction to be rotated so what we'll do is we'll say Direction dot equals Direction dot rotated and we'll need to actually rotate it based off of our camera controller so we'll say Vector 3 dot up as our up Vector and then we could just say h rot like that Dot normalized and it says identifier H Rod was not declared that's because I have a capital R so I guess I should stick with lowercase R if I remember correctly that's Godot standards and I had some people telling me I should use Godot standards so I'll do that and then we will pass in our blend position equal to our Direction like that and hopefully that will just work so we'll hit refresh and let's test it out so we'll hit w s a d if we rotate that kind of works but not really it is going off of our rotation which is good actually I think it is working I just think that it's yeah I think it's actually working I just don't think that um that are forward and backward is working the way we want it to so let's take a look and let's print out our Direction I think I know what's going on let me take a look at our script here we're passing in a vector two if I remember correctly no we're passing in a vector 3. so my question is I think this needs to be a vector 2 like this and I think we need to say Direction dot X comma Direction dot Z and now if we hit play Let's see what that does so we hit forward we start backing up we hit s we start running forward awesome so now if we move our camera you'll see that our character reacts kind of as you would expect although they're not quite as we would fully expect them to so we need to set up our character so we can rotate it with our camera while we're running around while still maintaining their direction that they're attempting to go so if we head back here we come down here let's come down to where we are setting our velocity and I believe we are setting our current rotation right here based off of that so I think we'll come up here and we'll just say rotation is equal to a vector 3 rotation dot X comma rotation dot y comma a tan 2 minus Direction dot X comma minus Direction dot Z comma rotation dot Z and hopefully that will actually fix our issues here so let's come in here we'll hit w s well that sort of worked but not really it's quite broken now now the reason why it's broken is because if we look at our animation blend position we're setting it to whatever our direction is and if we rotate our character that's going to really mess up our rotation now I don't want to get rid of this because I'm going to show you guys how to do something cool in the future so I'm just going to copy this and paste it like that and I'm going to come in here and I'm going to set this to a new Vector 0 minus one like that and that will basically allow you to have your character controller like you would expect so if we hit play here and we move we move forward we can run around like you would expect we can rotate our camera and move our character and there we go now you'll notice that when we let go our character rotates to whatever is considered zero and we don't want that so we gotta actually check for that so we'll come into our rotation and we'll just say if direction does not equal a vector 3.0 then do this that way it doesn't rotate the player when we let off of our movement so that way our character stays in that rotation so if we go this way our character stays that direction like that and there we go now if you remember from our actual character controller tutorial we made it so that when you right clicked it would make your character focus in out of direction right they would actually focus in and they would strafe and do things like that well if we want to keep that control all we have to do is basically just reset it up so go to our test scene click on our camera go to 3D let's right click add in a child node add in a node 3D we'll drag this guy up to our node 3D we'll call this look at like that and then we'll just drag this guy really far off in the distance it needs to be pretty far from the distance for it to work and yes I realize there are ways to do this without doing it this way but I just like doing it this way to me it just works really well so we'll go back to our character script like so and will basically come in here and just say on physics process we'll just say VAR look at is equal to get tree dot get nodes in group quote camera controller we'll pull back that first instance and it will just say dot get node and we'll pass out our path of look at and I believe it was a capital A if I remember correctly let's take a look at our Scene It is capital A so perfect and then we can just come down here and say okay if our right Mouse button is down then we can basically set our blend position so input is mouse button pressed and we'll just say right Mouse button like that and then we'll just uncomment this guy and we'll need to also check for that for our rotation because when we do this we don't want our character to rotate to a position we want them to actually look at a position so kind of like how we have this guy here we need to just check for that so we'll just say if input Dot is mouse button pressed and we'll do mouse button right now customarily I like to do bindings for these but for this tutorial just make it easier for me to do it this way we'll say look at and we'll pass in our look at position and we actually need to have look underscore at like that and that'll make us so that our character looks at that position and then I'll just say El if our direction is not Vector zero then rotate our position and that should basically set that up hopefully for Success so we can refresh we can move left we can move right we can left click and we have a crash so it says invalid function look at and base cannot argument uh convert my object to a position so dot Global underscore position we'll refresh that you'll see our character now faces the wrong direction so what we can do and to mitigate that we can just go into our test scene we can grab our look at and let's actually just make it look at our camera instead so we'll just drag this to the other side and then we'll hit refresh and you'll see that our character if we right click now looks in the proper direction and there we go so now we have a character controller that's much like what you would expect in most games now you'll notice that our character does lean forward ever so slightly and I think the reason why that is because our Direction y probably needs to be flipped so let me see if I can do this let's go to our script let's come down here let's change our Direction Z to just regular Direction Z Also let's take a look at our look at and instead of doing look at dot globalposition let's do look at space Vector three globalposition dot X comma Global position dot y comma and then same thing with our look at globalposition dot Z and that's basically going to fix our issue where we were running into our character kind of moving up and down and that's because we actually can't look up and down and have it um not Orient our character if that makes sense so this will help keep our character orientation correct and then we can just hit refresh right click and that should be okay and then if we hit forward there we go we click and our stuff is still quite broken because it's not based off of our camera position and the reason why is because we're setting our direction to direction.r rotated normalized so if we come up here we basically just check to see if our Mouse button is pressed then we could basically just say hey if it's pressed don't worry about it so we'll just grab this and say if our button is not pressed then we will able we will rotate our character based off of our camera because previously we are setting our Direction so that it was um normalized off of the camera rotation but when the camera is locked onto something I don't need to change States I just need to stay looking forward if that makes sense so now I should be able to hit play and I should be able to go left right up down and I can move my camera and my character respects that I can hold click and my character respects that as well and it's pretty much as you would expect awesome and that's basically how you do a root motion system with a character controller inside of Godot so if you like this video go and hit that like button hey you know if you dislike this video go and hit that dislike button because I am here to make content for you guys this video was a viewer suggested video so if you have any suggestions please leave them in the comments below and I'll be more than happy to take a look at them I am working on that vaulting system as well that'll probably just be a quick update to probably like a five second video hopefully although for me a five second video means about 20 minutes but hopefully it will be a pretty quick one once I figure it out I think I need to shut off gravity while the character climbs but for right now that's something that I'm investigating and hey if you have any questions or comments please leave them in the comments below and I'll be more than happy to help you out or you can jump on the Discord link is in the description and anybody on the Discord is always willing to help you out with any issues you might be having but that is all I have for you guys today so thank you so much again for watching and I will see you all next time thanks [Music]
Info
Channel: FinePointCGI
Views: 16,456
Rating: undefined out of 5
Keywords: godot, godot 4, godot engine, godot shooter, godot 3rd person shooter, third person shooter godot, godot shooting game, godot projectiles, godot optimization, root motion, 3d game godot, godot 3rd person controller, godot game engine, godot tutorial, godot 4 tut, godot 4 port, godot game development, godot multimesh, godot 4 features, godot 4 tutorial, migrate to godot 4, godot 4 third person controller, godot 4 navigation, godot animation, what is root motion
Id: fq0hR2tIsRk
Channel Id: undefined
Length: 47min 41sec (2861 seconds)
Published: Tue Apr 04 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.