Creating a 3D Character Controller With Animations with Godot 4!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys this is Mitch with fine boy CGI and today we're going to talk about how to build a 3D character controller with animations inside of Godot so we're going to go through the process of building out our basic camera rig we're going to talk about how to build a character movement system we're going to run into a little bit of bugs here and there and we're going to fix those and then we're gonna talk about how to use the animation tree system to hook up our animations that's what I have a store for you guys today let's go ahead and get started Okay so the first thing that we need to do is we need to actually build out our character controller now you guys will notice that I already have a scene created and down here in the bottom right I actually already have a character built now the reason why I did this is because I figured it'd be easier to streamline everything than go through 30 minutes of setting everything up and getting everything going but if you guys want the project you guys can just download it in the description below and go from there if not just basically use a mesh and you'll be good to go it'll be easy enough now I already have my character done now my character is not done by me directly it's done by miximo including all of the animations and things like that and here is miximo right here it's a free place from Adobe that basically has a bunch of animations and a bunch of characters and things like that that you guys can use and then I downloaded all my animations I dropped it into blender and then I basically compiled all my animation together now the easiest way to do it is just to download each fbx and then basically just go in and delete all the other armatures and then it'll automatically combine them all together more or less but this tutorial is not about that so let's get building our character controller the first thing we're going to do is we're going to instance our character into our scene so we're going to right click our character we're going to create a new inherited scene and you'll see the character right here now because I have this as a glb file it already has an animation player that has all of my animations loaded right here so you can see I have my fall land I have an idle animation things like that so to set up our character what we need to do is first we need to change our base node we're going to make that into a character controller so we'll come in change the type type in character and we'll make that into a character body now character body is a body type that means it needs to have some kind of collision okay you can't have a character body or really any type of body static or kinematic without having some kind of collision we're going to right click our character body we're going to add a child node we're going to add in a collision shape 3D we're going to click on the Collision shape and we're going to create a capsule shape like that we're going to hold Ctrl and drag this guy up so it is perfectly in line with their feet like that and then we're going to hit Ctrl s and we're going to save this as player Dot tscn and we're going to go back to our scene here and we are going to instance in our player just like that we're going to drag them in and then there we go we have our player in our scene now we have to set up our player movement so if we right click our character and we attach a script you will see that it says hey we're going to attach a character script you'll notice that there's a template here called character body basic movement and that literally handles all of our basic movement for us so we'll just click create you'll see in here it has all the code that we need so that's really cool so let's hit play and let's select our current scene and I'll save it real quick and you'll notice that our scene has nothing going on and that's because we don't have a camera so let's get rid of this real quick like so and let's come into our node 3D let's right click it attach a child node and type in camera because you need a camera to be able to see if we drag this out like so and then we hit play you'll see we have ourselves a character right here if we hit left and we hit right you'll notice that they go left and right respectively we hit forward and backwards you'll see it they go forward and backwards respectively so that's really cool right basically solves our problem of creating a 3D character movement so the tutorial is done well not quite we want to handle our character our camera rotating around our character we also want to have our camera follow our character so how can we do that well that's really simple if we come over here to our camera here and we right click on our node 3D and we add in a node 3D we can drop in another node 3D and I'm going to leave it right here at the center of our character I'm going to put my camera underneath my node 3D I'll call this my camera controller now we need this camera controller to follow our character so we're going to need to script it now we could put it as a child of our character but that's going to run into a lot of problems in the future where if we rotate our character it's going to rotate our camera and we don't want that because we want it to be separate from each other so that way we can rotate our camera independently of our character and things like that it's going to make things a little bit more flexible a little bit easier to use so we'll right click our camera controller we will attach a script and we'll call it camera controller.gd and we'll click create now to get this to follow our character we need to get a reference to our character and the easiest way to get a reference to our characters by using groups I know that a lot of people say Hey you know you can do a lot of things like get tree get root and then grab our character right but doing it this way is very flexible and very simple so I'm going to click on my player scene right here I'm going to click on my character I'm going to my node groups and I'm going to come in here and say player and then I'll come up here and I'll create a VAR player I'll come down here and I'll say player is equal to get tree dot get nodes in Group quote player like that and then I'm basically going to pull back that first element and that'll grab back our player and then we can basically just say Global position is equal to [Music] player.globalposition we hit play you'll see when we move our character our camera now moves with our player simple enough and if we hit the space bar you'll see that we can jump because our our pre-built character controller actually handles jumping as well so now we have that which is great and it solves the majority of our problems right we have a very basic character controller but what if we want to move our Mouse to make our player rotate with us that's where input handling comes in so if we come down here and we type func underscore input event we can actually start capturing our input events now there are two ways to capture input events and I've covered this in previous tutorials but basically you have input is action pressed and then you have the input function event and the input function event will run anytime an input happens so if you hit W this function runs if you move your mouse this function runs if you click this function will run so that's something to keep in mind now in our case since we're moving our Mouse and we want to capture that event we basically have to do it this way but we don't want to move we don't want to rotate our character every single time we hit waasd we want to rotate our character anytime we move our Mouse so we need to check for that so we'll say if event is input event Mouse motion like that then we can rotate our character we can say rotate rotation dot x minus equals event dot relative dot you'll see we have two options we have X and we have y and you would think that we'd want okay well if we're going to rotate X we should want to rotate on X but if we look at our 3D and we change this to rotation you'll see here red is X green is y when we look at it from behind if we rotate our character like this we would want to rotate along the y axis because we want them to rotate around this way and if we rotate up and down we'd want to rotate like this so we have to use that to translate our rotation code so event dot relative y instead now I'm going to take this I'm going to divide it by a thousand and the reason why is because you're taking it from 2D and you're making it into 3D and when you're taking something from 2D and you're moving it into 3D you need to divide it by about a thousand to make it a one-to-one translation and then we're going to multiply that by some kind of sensitivity and what I'm going to do is I'm going to come up here and I'm going to say at export bar sensitivity we're going to make that colon equals five and we'll just say sensitivity like that now I'm going to duplicate this guy and I'm going to say rotation dot Y and eventrelative.x and that should do it so I'm going to hit play like so and you'll see when I move my mouse it rotates around my character now you'll notice that I can go past my actual rotation and then things get a little bit funky so we need to set up some kind of upper bounds to our rotation we don't really need an upper bounds for our rotation around our character but we need upper bounds for our rotation above our character and below our character because we don't want to go through the floor so how can we do that well that is where clamping comes in clamping allows us to clamp our rotation value between two numbers so if we come in here first we need to set up a variable so I'm going to take this guy I'm going to take this guy I'm going to cut him I'm gonna put them on this side paste minus I'm going to get rid of this minus here and I'm going to say VAR temp rotation is equal to rotation x minus event relative Y and the reason why I did minus rotation x minus event relative Y is because if I did minus equals temp rotation it would be 0 minus equals our event relative and we don't want that we want to take our current rotation and minus our relative rotation because that'll allow us to have that continuous rotation we will not continuously start from zero if that makes sense and then if we come in here we need to clamp our value so we can say temp rotation is equal to clamp temp rotation comma we need to come up with a minimum value in our case I'm going to do minus one and we need to come up with a maximum value in our case I'm going to do 0.25 and that's just a lot of testing on my part if you want to change this you can but basically this is my floor this is the top of my character that's how I how I know them and then I'm going to say rotation dot X is equal to my temp rotation like that and then I'll refresh and you'll see if I go up I can't go past this value here and that's my 0.25 here if I go down I can't go past my floor which is where my minus 1 is located so it's really that simple so now how can I handle if I have a object occluding my screen you'll see that I'm kind of colliding with this wall here and I want to be able to see my character well that's where spring arms kind of come in so a spring arm is a really cool tool inside of your Godot toolkit if you right click on your camera controller adding a child node and type spring you'll see we have a spring arm right here and basically all this does is it says Hey I want to make sure that my character can be seen at all times I want to make sure that if I collide with a wall I don't go behind the wall I just kind of collide up against the wall so we'll double click that guy in we'll put it underneath our camera controller and we'll drop our camera 3D underneath our spring arm and you'll notice that everything breaks all of a sudden and that's fine because we're going to refresh anyway and we're going to need to make some adjustments if we click on our spring arm you'll notice that we have a Spring Lake length I'm going to make that set to 5 because that's a good solid size you'll see we have a collision mask now we want to be cautious with our Collision mask because our Collision mask can basically make it so that we collide with our player so if we set this to two and then we come into our mesh instances here and we go into our static bodies and we set both of those to two as well that'll allow us to collide with our world but not collide with our player and if we refresh it let's take a look at what it did so you'll notice that we no longer are going into our wall so if we run up against our wall like so you'll notice that our camera no longer goes through our wall but you'll also notice that we are zooming into our character's feet every time and we don't want that we want to be able to look at our player see that and we're going to need to adjust our downward one because it looks like we can go through the floor a little bit so we can make that quick adjustment here by basically changing this from -1 to something like minus [Music] 0.0.75 probably actually I think we're gonna need to go maybe zero here see if that does it that's really really close we'll just do minus 0.1 Maybe and there we go cool so we need to be able to look at our character right right now we're looking at the feet of our character and that's really really difficult to deal with so what can we do to actually make it so that we look at our our head of our player which is usually where you want to look well the easiest way to do that was with a look at function but you need some kind of Target to look at if that makes sense if we head to our player we right click our character we go into 3D mode we right click our character add a child node and let's add in a node 3D like so and we drag this guy up to our character's head and about where their shoulders would be located so we can just kind of drag this guy right about here-ish and that'll be great we'll call this look at and that's going to provide us with some kind of reference location for us to look at if we hit Ctrl s and we save that and we go to our node 3D we click on our camera controller and we come up here to our process function here we can just tell our camera to look at our character so we'll say dollar sign camera3d dot look at and we'll need to get a Target and our Target's going to be that look at note so we'll say player dot get node quote look at dot global underscore position and that should in theory work so if we hit Refresh on our player you'll see we are now looking at the proper location on our player and everything feels a lot better than what it did before so cool so now we have it so that our character can go to the left go to the right they can jump they can go forward and backwards and you can see my controls are a little reversed because I need to rotate my character but that's okay we'll get to that in a minute and we have it so that our camera actually works properly so cool so we're basically 90 of the way there but what if I want my character to look at my position my camera position well to do that we need to basically create some kind of look at for our camera and the easiest way to do that is to actually just use a node so if I click on my camera controller and I right click and I add in a child node and I add in a node 3D like so I could basically just drag this guy out here and have it just sit out here in space now I could do this by taking my camera location and then doing some math and then getting the negative vector and stuff like that or I can just drop this little node 3D in here and just call it look at and be done with it so sometimes the simplest option is always the best option in my opinion so I'm going to drop this little look at node here and I'm going to use that to tell my player what to look at so if we head up to my character controller let's set up that look at function so if we come in here we can basically just say look at and we can pass in our players cameras look at node now we can't just get a reference to our camera controller like that we actually need to get a hold of it kind of like our player we need to get some kind of node group so if we click on our camera controller here we go to node we click on group and we come in here and we just call it camera controller like that and we copy it and then we can come in here and just say get tree dot get nodes in Group quote camera controller we'll pull back that first element dot get node and we'll pass in our look at node dot global underscore position like that and then if we hit Ctrl s and we refresh it you'll see that our character now rotates with our player and if we hit W you'll see that now we can move around our world with our character now something that has been bothering me for a while but I haven't really fixed it is our Mouse isn't being captured by our character controller it's just kind of sitting off in space and that's something that we need to fix so let's fix that real quick before we fix our character rotating up and down you'll notice that our character actually rotates up and down when we move our Mouse up and down and we don't want that we want our character only to rotate left and right in proportion to where our Mouse is so first to fix the cat Mouse capture issue if we come up to our camera controller here we go into our ready we actually have an input specific for that so we can just say input to grab our input class dot mouse mode is equal to Mouse mode captured and then when we refresh you'll notice that my mouse now gets captured and I can just kind of move my mouse left and right and my character my mouse will never leave my screen and then to leave I just do alt f4 and that will take me right out now to fix our character rotating with our Mouse up and down we basically need to separate our look at into multiple Vector 3 positions so we can separate our Global position into three our three Vector positions so first things first I'm going to make this a little bit smaller by grabbing all of this so I'm going to grab this look at section here I'm going to cut that I'm going to come in here and I'm going to create a ready function so func underscore ready like that and I'm going to say up here VAR look at and I'll come down here and I will drop in a get node look at that way I have a reference to that object and then I just come down here and I can say look at a new a vector 3 like this and I can pass in my look at Global position like so dot X comma my players global position dot y comma my look at dot globalposition dot Z and then I can just get rid of this guy right here and that will basically handle our entire look at so that our character doesn't rotate with our player so if I hit play well we have a break so that's not good news so look at is null which shouldn't be a tree get nodes in group oh it helps if you assign it that's my fault so look at is equal to get tree get nodes in group camera controller that's my fault so if we hit refresh and we look up and we look down you'll notice that our character doesn't look up and down they just kind of look forward which is what we want in a character controller now this is cool but our characters directly rotating with our camera and we don't necessarily want that we may want our character to have like a lazy rotation so they only rotate when they're walking so how do we do that well that's really simple so if we come back to our script and that's really simple but before we do that let's make this look a little bit better let's go back to our script here let's go to our 3D section here let's click on these three dots and let's add a sun and let's add an environment and that'll help with making our stuff just look a little bit better now let's head over to our script and let's set up our lazy looking system so if we look at our code here we set our velocity here when we're moving and this means that we are actually moving we have some kind of input Direction so let's cut our look at and let's just drop it right into here and that will solve that issue so if we hit refresh you'll notice that when I rotate the camera our character doesn't rotate with us but as soon as I move they snap to that location and I'm going to flip my character real quick if I come into my player and I go into my 3D I'm going to grab my Armature and I'm going to flip this guy around so that way it's actually you know the proper facing Direction there we go and I'll just refresh it like so there we go that's a lot better you can see our character moves with us whenever we move our camera and whenever we walk like that but I don't like how it just snaps into position I'd like to make it more lazy right more have a lazy load kind of effect so the character kind of rotates to follow our position so that way they have momentum when they're walking that's where lurping comes in so if we come up here basically what the lerp function does is it allows us to slowly migrate over there so if we type in alert you'll see that we have some things here we have our our variant from our variant 2 and our weight so we need a from position a two position and our weight of what our variant is so the easiest way to do this is to say VAR lerp Direction is equal to lerp and what we're going to do is we're going to lerp two values here and we're going to lerp our last look at direction right so where we were before to where we are now so what I'm going to do is I'm going to come up here I'm going to create a variable for that so VAR last look at Direction and I'm going to make that into a vector 3 like so then I'll come down here and I'll say lerp our last look at Direction comma and then where we're trying to lerp to now we don't really have a look at Direction so what we can do is we can just grab this guy right here we'll cut that we'll paste it comma and then we need to come up with some kind of weight value in my case I'm just going to do one for right now and that'll probably be way too slow but we'll see so we'll set it to one and then our look at we'll just look at our lerp Direction like that and then we need to set our last look at Direction equal to our Direction like that and then if we refresh this it should work so if we rotate like this and we hit forward well not quite so let's take a look at what's going on here so I'm going to come over here I'm going to change this to something like 0.05 if you get any slower like 0.01 it could break your system so just make sure that you don't put it too low but 0.05 in my testing has worked so we'll come in here and you'll see that our character now rotates smoothly to the rotation that we're looking for awesome that's going to make things feel a lot better now comes the fun part animations so I'm not going to go into too heavily of an explanation of how things work because I don't want to bore you guys with how an animation tree works and all that stuff but I will show you guys the basics of how to do it so if we go back into our player here and we right click our character controller and we add in a child node we add in an animation tree node right here animation tree allows you to basically say I want to be in this state or I want to be in this state I want you to play this animation or I want you to flow into this animation things like that so what we'll do is we'll come in here we'll go into our inspector click on our tree root and in my case I'm going to do a state machine you guys can do a blend tree if you want to but in my case I'm going to do a state machine so I'll click on state machine and I'll come up here I'll right click edit an animation and you'll see that nothing shows up this is a common problem that a lot of people run into and the way to solve it is to assign an animation player so if you click on assign you click on animation player hit OK if you right click add an animation now you have all of your animations the first one we're going to add is idle and if we go to 3D now we can see our idle animation so if we click on this guy we drag our start to our idle what that's going to do is it's going to say hey onstart do an idle and the way to test that is to click on our animation tree and then click active and you'll see our characters playing our idle animation now what if we want to walk well if we click and drag and let go we can add in a walk animation we can add animation walk and now you'll see that our character is going to walk and you'll see that they paused and the reason why they paused is because our animations are not set up to repeat let's grab our idle animation let's click repeat let's grab our walk animation and let's click repeat let's click on our strafe left repeat strafe right repeat and our falling idle repeat the rest of them we don't need to have a repeat but those three or five math I do need it so we'll come back to our animation tree like so and we'll do a transition back down now you'll notice that our characters transitioning between these two states constantly and we don't want that so how do we know when we want to go to a walk state or how do we know we want to go go to an idle State that's really simple if we click on this guy here we go into advanced we can actually do a switch condition and so our condition our switch condition is going to be walk and you'll see suddenly we are now doing our idle animation and if we come to back to our animation tree like so and we click on parameters conditions you'll see we have a walk parameter if I click the check box you'll see our character now suddenly is freaking out and that's because we need to create a transition back down and we need to switch our transition much like we did walk we need to create a condition so click on here and say idle and now our characters in its walk State basically playing the walk animation and then if I come back to my animation tree you'll see if I shut off walk and I turn on idle we go to our idle State I shut off idle you'll notice that our idle state is still running even though it's off it'll still run that state because it'll stay in the state as long as the next transition is not true so if I hit walk you'll see he goes into walk so that's basically how that works so if we click on our transition and we drag out we can add an animation and add in a falling idle transition you'll see that our character is now falling idle and when our character Falls we want them to land so we'll click add animation ball land and when they land we want to go back to our idle State like that now you'll notice something weird if we click on our animation tree here and we click walk will immediately drop into our fall idle we'll fall land and then we'll drop to our idle immediately so we don't necessarily want that right we only want to do our walk to fall Idol when we are falling so we'll add in a condition called Falling and now if we transition into our walk cycle like so so walk falling we shut off our walk it immediately drops into our idle State we don't want that right we want to be able to play our animation until it completes for our fall land but we don't want to have to set up Boolean state for that right we want to have it so that it falls Lance finishes the animation and then goes into idle state right that's where the switch right here comes in we can change this from immediate to at end and that will solve that problem so if we come into our animation tree we can turn on our walk we can fall and then once we finish our land it'll transition to idle like that so that's basically how we can do it now we do not want to transfer from falling idle to fall land until we've landed right so let's come into our condition and let's set up a land like that so landed so basically when we go from our walk to our falling we will not land until we say landed and then we'll transition to our Idol and that's basically how you do a basic state machine within Godot now the question is how do we control this through code well that's really simple so if we go into our character script right here we can come down here at the bottom and we can set up our script to work transition our states so if we hit dollar sign animation tree Dot set and we can set some parameters now we're not really getting too much Auto completion here and I think the reason why is because my script is not attached to my player scene so let's drag our player.gd onto our character that should help a little bit if we hit quote you'll see now it's popping up with our stuff and we'll start with our idle state so we'll say idle comma and now we can set a value and we should set a true or a false value now what I would always tell people is you should make your stuff State related and what I mean by that is you you shouldn't just say true or false you should set it up so that it gets set by some kind of dynamic value so for instance up here we're inputting a direction right if our input Direction here is equal to a vector 2 0 then we know that we're not going anywhere so we can just basically grab this guy and just say input dur equal equal vector 2. like that dot zero and now if we have no input for not touching the keyboard then we will go to our idle state but we also want to make sure that if we're falling that we're not doing an idle state that we're doing our fall state so we need to check for that so we can just say and is on floor so if we're on floor and we're not touching our keyboard then we go into idle State now we can do the same thing if we copy this and say I believe it was walk so walk and instead if we say does not equal zero and is on floor and then we can do the same thing for falling so copy paste come in here falling if we are not on the floor easy enough and then we can do the same thing with our landed like that if we are on the floor if we're on the floor we know we've landed and that's basically how we set up our little State machines now if we hit play our character is an idle State you can see they are playing the idle animation if we hit W our character walks easy enough if we hit jump well it doesn't quite work but if we jump and we let go you'll see that it does work so what's going on with that and you also notice that for some reason our character is moving forward when they shouldn't be so that's something that we're going to have to look at so what's going on with that so first we'll solve we'll solve the jumping and landing and the jumping idle and Landing issue that we're running into why do we have an issue with that well basically what's going on is if we look at our state machine and we look at our animation tree here we can only go into a fall land into our Idol we can't jump from our Idol we're only falling idle from our walk animation so we can only play that animation when we are walking if that makes sense so we need to make a transition from our Idol to our fall Idol as well and then we can say if much like we did here falling then we can go into that transition there and same thing with our fall land we can go into our walk animation only if we are walking like that and that will solve that issue so if we come in here and I jump we are now playing our jump animation easy enough if we hit W and we jump we're good if we jump and we continue walking you'll see that we transition from that pretty alright like that now there's a bit of finickiness there that we're gonna have to play with but at least it works now something that you'll notice is that a when we do left and right our character doesn't strafe left and right so we're gonna need to set that up and you'll also notice that we have a slight issue where our character for some reason gets tilted when we do our jump and the reason why that's an issue is because of this little lerp direction if we change this to a vector 3 and we drop in lerp Direction dot X comma Global position dot y comma lerp Direction dot Z that should solve our problem and the reason why this solves our problem is because and I need to put an extra closing there there we go the reason why that solves our problem is because when you jump your Global position changes and you don't want to lurp between your up and down position you only you want your position to be exact always so if we hit play you'll see that we no longer run into that issue and there we go that solves that problem awesome so now we just need to set up a few smaller things if we hit W you'll notice that we kind of snap into position and we don't want that so how can we stop ourselves from snapping like that well that's where transitions come in we look at our animation tree here we select our walk movement system here you can see we have this x fade curve and X fade time and these two values allow us to flow into our transition I believe if we set this to something like 0.2 something like that I don't think that that's going to directly handle our issue but we can test it real quick so if I set these guys to 0.2 and I refresh it oh it does so you can see now we no longer snap into position we kind of flow into that position and if we go back to our uh go back to our animation tree if we select our walk point two we select our fade land point two we do our idle to jump point two same thing with our land to walk point two our idle 0.2 and that should do it so now if we hit refresh we can jump you can see it smoothly does that transition and that's what we want now this one here is going to be a bit finicky as you can see we do our land animation into our walk so we're gonna have to figure that out as well we may need a third animation for that so I might leave that to you guys but once we have that all we got to do is set up our strafing if we right click add an animation add in strafe left and add another animation add strafe right we can basically set all this up and this is where State machines get really really complicated and painful so if we click on our transition we say okay well we can transition from our walk we can also transition from our idle we can also transition from our strafing and we can transition from these guys back to these guys we can also jump like that and you can see suddenly how complicated this could get it becomes difficult really easily so now we can just say okay from our Idol to our strafe left we're going to be able to do that when we strafe left so like that and then we could do this when we go back to idle state so idle and then we could do this when we strafe left like that and then we can do the same thing here when we strafe left and we can do let's see it gets messy really quick so you gotta kinda mess with it I think that's all my strafe lefts yes so now we got to do all of our strafe rights so let's grab this guy straight right we'll copy that we'll come in here strafe right we'll go into this guy here strafe right and we'll go into here when we're falling so and you can see what I mean by how complicated this can get so quickly and I'm sure that there's a better way and I'm sure somebody's gonna say well Mitch why don't you do this and I welcome if you guys can simplify this that would be awesome but right now this is how I know how to do it so we'll do it this way and that should be all of the states oh I missed one so walk go so now if I come in here we're going to need to make some changes because we need to hook up those booleans so with our walk let's copy these guys paste them and put strafe left and strafe right like that you can see if input dur does not equal vector 2.0 instead we're going to say if input dur dot Y is equal to 1 or input der dot Y is equal to minus one and we're going to need to wrap these boats so that way we make sure we handle that use case so that way if either one of these guys and we're on our floor and now we need to do the same thing down here except for this time it's going to be a little bit simpler so if input dur dot X is equal to one and if input dur dot X is equal to minus 1. like that now if we hit refresh that should work so if we hit left well so we have it flipped first that's broken but we definitely have it flipped so let's do that first so let's flip these guys like that and it looks like when we do our left movement our character goes the wrong kind of transitions between different animations that means we missed one so let's look at our animation tree and let's see so strafe left idle drift left walk straight left strafe right balling strafe right and we missed one of our walking so walk like that and that should solve our strafe right issue so now if we hit refresh if we go right we walk right if we go left we walk left w we walk w and there we go now our character doesn't lazy move on our strafes so we can set that up real quick come in here x fade time 0.2 X fade time 0.2 X fade time 0.2 and you can see how boring this gets all right let's try that so if we hit left we transition there we go that's a lot better A lot smoother movement there we go and now to fix that jump while we're walking what I'm thinking will do is instead of doing our animation tree into our fall land what I'm going to do is once we land let me check some code here so animation tree walk and walking hold on a minute so we got walking walking let's try walk instead of walking see if that fixes it yeah that's that's a lot better yeah that's a lot better I think that'll work so that's my fault I made a mistake on this part but there we go I mean we basically have ourselves a very basic character controller that does the animations and does all the things that we need it to do now we might need to check again our animation tree because when we do our strafing we also need to handle that when we do our land so technically speaking we should be doing this as well and then setting this up as well so and then if I refresh there we go that's a lot better and that's basically how we create a 3D character controller with animations 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 is 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 put it on my list to make or the future all of my videos our viewers suggested so that's something that I enjoy now I haven't forgot about my horror series I will be making a new video on how to create a object investigation system that's next on my list to record I have it built out I just need to record it and edit the video so look forward to that and hey if you guys have any questions or comments please leave them in the comments below or hit me up on Discord link is in the description I'll be more than happy to help you out with any issues that you may run into but that is all I have for you guys today so thank you so much again for watching I will see you all next time thanks foreign
Info
Channel: FinePointCGI
Views: 52,610
Rating: undefined out of 5
Keywords: godot, character controller, godot character controller, godot engine, godot character animation, third person character controller with animation, 3rd person controller godot, godot 4, godot animation, godot tutorial, making a game in godot, godot game engine, godot visual scripting 3d character controller, godot 3d character animation, godot animation tutorial, c# godot | creating a celeste like character movement system
Id: eGt7ikx7FcQ
Channel Id: undefined
Length: 46min 25sec (2785 seconds)
Published: Mon Feb 27 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.