 Hello, and welcome to another minimal Godot tutorial. Today we're going to talk about variables. If you've done programming before, you probably know what a variable is and why you have them. If not, I'm going to explain it right here and right now. This is from our previous video. I'm going to hit F6 to run this. And now I can use my arrow keys or WASD to move this little player around. Let's go ahead and quit out of that. We can change the speed by changing this value here. So for example, moving to the right, let's say I want him to move quite a bit faster. I can change this to five. I can hit F6. And now if I hit right, he moves pretty fast. But if I hit left, he still moves slow. Up and down, but right, he moves fast. So when I'm creating the game, if I want to change how fast he moves, I would have to come in here and change each one of these each time I want to change how the player moves. Variables help fix that. Up here, I'm going to say var speed equals and I'll say five. Now I can come down here and I can say speed, speed, speed, speed. If I hit F6 to run my game, I can now move him. He moves in all directions at the same speed. If I decide I want him to move faster, I can just change that variable in the one place. And remember, your code could get very big and you could have hundreds of lines of code in this script. So having the variables there are nice because now he's moving in all directions at the same speed. I can go back to one. And again, I can go right, left, up, down. Now, something that should be mentioned is I put the variable up here at the top of the script outside of any functions. You can now access this variable inside any function. If I was to take this variable and put it inside this function and hit F6, you'll see it still works the same and I can change that to five. And now he'll move faster. But I won't be able to call that speed variable in any other function outside of that function. So in creating variables, it's just you need to think, well, I need this other places. And certain things like the speed of your character is probably what you want as a global variable for that script. So you'll probably have it at the top there. So that's it for creating a basic variable and why we have variables. And almost everything is gonna be variables in code to keep things simple like that so you don't have to search through your code and change things. So thanks for watching. Visit filmsbychrist.com. That's Chris with the K. There's a link in the description as always. I hope that you have a great day.