Creating Basic Player Movement In Unity

Creating player movement in a game is often times the very first thing any developer does after setting up their project. It allows for user interactivity during playtesting as well as world navigation all in one.

[Note]

One simple way to get an object moving both on the horizontal axis & the vertical axis is like this…

[Additional Info]

Vector3.up = Positive Y Axis

Vector3.forward = Positive Z Axis

By putting “.forward” in instead of “.up” in your Vector3 you will move your player up the “z-axis” instead of the “y-axis”.

To find the different built-in inputs go to Edit>ProjectSettings and you should see a window that looks like the one shown below. Select “Input Manager” and under the “Axes” drop menu you will find a list of all the different values that you can type in place of (“Horizontal”) or (“Vertical”) that we used above.

[Note]

Hi, my name is Adam Reed and I am a software engineer specializing in Unity and C# development. Feel free to scroll through and check out some of my work!