 Hello there, did you guys ever wonder how you could make your AI look more natural, especially while moving? Well, that's one thing called steering behaviors which can help you. But first, in order to understand them, please check GDQuest's video about Vector's Math. This one is more or less an application of Vector's Math, with GDQuest and I are collaborating to show you. To talk about steering behaviors, first let's talk about the problem they solve. When you are developing a game with AI, you of course want it to be as natural as a conscience being. One of the main problems you face is the movement, how you can make them move naturally. For instance, take a look at a simple follow the player implementation. Did you see? The movement is what people from the area call, oh my god, I forgot my clock. It is a subtle movement, instantly moving towards a target, abruptly changing the road. In order to fix that, they come with a solution. What if instead of moving straight towards a target, the AI gradually changing the road? That's what it is. Basically, the AI will be moving directly to the target, but will be applying a force to keep it out of the desired road, by moving it a little bit every frame until the desired road meets the steering road. By doing so, the movement will become smoother. To do this, let's start our recite by adding a kinematic body to the, since we will be applying physical forces, I think it is a good starting point. One add a sprite node as a chart just for visual feedback. Everything else will basically be done within a script, so let's abstract the logic. The algorithm is very simple. Take the desired velocity, which is the force straight to the target at full speed, then create a steer force, which is the difference of the desired velocity and the current one. After that, apply the steering force to the current velocity. The steer is a very strong force, so multiply it by some lower force to cap it down. Set the current velocity to be the new steered velocity. And we are done. Now we just need to implement it with the script. So inside the kinematic body to this script, let's add our data first. We will need a maximum speed constant to set the velocity of the character, a maximum force to cap the steering force, this is used as a smooth control, the lower the smoother. Let's also create an empty vector too for the velocity, and a variable of the target position, which the character will move to, initially it will be moving to the initial position of the character. So well, it won't be moving at all. Turn on the fixed process callback inside the ready callback, this is because we will be always applying the forces. So let's create a function to do the steering, it will receive a target position to move towards it. Just set a path to keep it declared, we will be back to it soon. After the fixed process, we will set the velocity to whichever value to return on for the steering function, and then we will be moving based on it. Don't forget to multiply it by the delta to keep the movement timet in seconds. Now let's go to the steering function. Let's declare a variable to the desired velocity, and set its value to be a vector too, with the values being the difference between the target position and the current position. Let's normalize it so we just have a unit vector with the direction to the target. To give it a magnitude, just multiply it by the max speed constant. Ok, first step, check. Now for the steering force, just subtract from the desired velocity, the current velocity. Yep, that's it. Check. As for the target velocity, just add the steering force, multiply it by the max force constant, to the current velocity, done and done. Now let's set the target position as the return of the function, so it can be used as the new velocity value, check. And now we just have to set the target variable. For testing purposes, let's set it to be the mouse position. If everything went fine, that's how it should look like. That's what's called in steering, the seek behavior. Just as an observation, there's another behavior called flea, which is pretty simple to implement. You just need to invert the desired velocity in the steering, to do this, multiply it by minus 1. You can also create a simple state machine to control which kind of behavior you'd like for the AI, and inside the steering force, check which is the current behavior, and multiply the desired velocity as needed. And that's how it should look like. Did you realize that the character is bouncing when it reaches the target position? That's another problem solved with another steering behavior, which we'll use in the next video. We'll also talk about a more contextualized application for these behaviors. Now the link to the project in the github is on the description below. That's all for now, guys. If you have any doubts of something didn't get clear to you, leave a comment below. Oh, and if you liked the video, don't forget to leave a thumbs up. That's it. Keep developing any of the rest stuff.