 So I promised I'd show you how to improve your code. Not a problem. In order to do that, today I'm gonna show you the most important trick in the programmers book. And they're called variables. Now, I remember when my programming friends tried to explain variables to me the first time. And, I mean, bless their soul. I'm sure they tried their very best. And I'm sure they thought what they were saying was extremely simple. But they were talking to me as if I was another engineering student. But I'm an artist. So the more they explained it, the more confusing it got. I suck at math. And my brain just doesn't connect the dots like theirs does. Now, some people can hear a definition or read a book and understand everything. But for me, the only way I can really learn something is to see it and try to copy it. So I'm gonna try and explain this to you. Assuming that you're an artist or an animator like me. A variable just represents a value that you want to control. That's it. Functionally, that's all you need to know. If you watched the last video, we created a movement script using transform.translate and in translate, movement speed is controlled by these three numbers, which represent x, y, and z. If you set z to 1, it goes forward. If you set z to negative 1, it goes back. And you can change the speed by making these numbers bigger or smaller. 1 and negative 1 is probably a little too fast. So let's just use 0.01 instead. Anyway, the point is all you need to control position is to control these three numbers. So let's remove all this code and just go back to the basic transform.translate. Now we know that x controls left and right and z controls forward and back. So if we go up here and create a variable for x movement and a variable for z movement, we can then replace the zeros here with our variables. Save and if you run the game now, you will see that if we change the value of our variables, the cube will start to move. And here's what I want you to notice. The only thing that Unity cares about is the value of the number here. It doesn't care if you set it in code or if you replace it with the variable that can be changed in the middle of the game. Set in z forward to 0.01 in the game is the same as if you went in and typed in 0.01 here. So when should you set the value in code? And when should you replace pieces of it with variables? Well, my answer would be when you think the value might change. In our case, sometimes you might want to go left, sometimes you might want to go right, and sometimes you might not want to go anywhere. So sometimes x should be negative, and sometimes x should be positive, and sometimes it should be zero. So in the case where the number might need to change in the middle of the game, you probably want to use a variable. Now a lot of beginners will start to make the connection here and create some if conditions like, if you press a, x equals negative 1, and if you press d, x equals 1, and if you press neither, x equals 0. And you could do that for z2, and it would look something like this. And honestly, that's completely fine if you want to do it this way. But remember, Unity is smart. It's a game engine, and it knows that when most people want to move in a game, they either use WASD, the arrow keys, or the left stick on a game controller. So Unity already has a built-in variable for you to represent movement, but I think that's enough information for this video. So if you join me next video, I'll show you some built-in variables Unity has that can make your life super easy. As always, hope that helps. Hope you have a fantastic day. Now see you next time.