Road TO Dev — Lets move!

Rob Smith
3 min readMar 26, 2021

--

Going forward I am going to assume my readers have a basic understanding of unity and the functions I am showing here, but if not the best tip I could give is google it! For example when you see me use Transform and you aren’t sure why or what that does. Go google “Transform Unity” make sure to add Unity and the results will generally bring you to the Unity help page for that specific function and will give you loads of useful information. If that fails don’t hesitate to message me with any questions about what I am doing or why! :)

Now that we have our player created it’s time to get it moving! First create the script and make sure that when you do you name it before clicking off otherwise you’ll need to edit the name inside the script and that can often be overlooked causing many headaches later. If you don’t already have a folder in assets labelled Script you can do that now as well.

Make sure you attach the script to your player and then open up the script in your code editor.

Now we begin the task of making our player move. Thinking about what you would need to know to move for example; you need to know what direction to move and at what speed. So starting with that we can setup some variables.

With this setup we can set our speed in the editor to change on the fly to get a feel for it. Also the playerDirection is set to move along the Y axis (up) there are several ways to get this. Now in order to actually have our player move we need to access it’s transform and translate it!

Now let’s see what that does! Remember to click on your player and set their speed to what you want I am using 3 here.

Next up, player control!

--

--

Rob Smith
Rob Smith

Written by Rob Smith

Hi there! I am currently on the path to learn how to become a unity developer and will be documenting my journey as best as I can here. Thanks for looking!

No responses yet