Week 3 | Session 1 - Move Player within Boundaries - April 6, 2020
Tutorial
·
Beginner
·
+10XP
·
60 mins
·
(45)
Unity Technologies

You will begin this live session by creating a new project for your second Prototype and getting basic player movement working. You will first choose which character you would like, which types of animals you would like to interact with, and which food you would like to feed those animals. You will give the player basic side-to-side movement just like you did in Prototype 1, but then you will use if-then statements to keep the Player in bounds.
1. Overview
This is the same content covered in Lesson 2.1 in the independent Create with Code Course.
What you will make:
- The player will be able to move left and right on the screen based on the user’s left and right key presses, but will not be able to leave the play area on either side.
What you will learn:
- Adjust the scale of an object proportionally in order to get it to the size you want
- More comfortably use the GetInput function in order to use user input to control an object
- Create an if-then statement in order to implement basic logic in your project, including the use of greater than (>) and less than (<) operators
- Use comments and automatic formatting in order to make their code more clean and readable to other programmers
2. Before you Begin
To participate in this session and follow along, you need:
- Unity 2018.4 installed
- An up-to-date project open in Unity:
- If you have followed along with us this week and have your own project ready, you are good to go!
- You can also download the instructor's up-to-date project and import it (If you don't know how to import a project, you can read how here)
If this is your first Create with Code live learning session, you can catch up by:
- Following along with the recordings of our previous live learning sessions
- Completing the same lessons in the independent Create with Code Course
*Note - it is not necessary for you to catch up, but it is recommended for an ideal learning experience.
3. Recorded Live Session - 6th April - 9am PST
If you missed this live session, you can catch up with the video below:
4. Recorded Live Session - 6th April - 5pm PST
If you missed this live session, you can catch up with the video below:
5. Next Steps
Get caught up:
If you were not able to finish the session along with the instructors, you can catch up by:
- Re-watching this recorded session when it is posted in Step 3 above at 3am PT (10am UCT) the morning after this session's date
- Picking up where you left off in Lesson 2.1 of the independent Create with Code Course
Optional homework:
- Allow the player to move forward and backwards within a certain range
- Try letting the player control the character with the mouse
Extra credit:
If you want to go ahead and preview what we'll be covering in the next session, you can give it a try in Lesson 2.2 of the independent Create with Code Course.