Week 2 | Session 2 - Make the Vehicle Move - Mar 31, 2020
Tutorial
·
Beginner
·
+10XP
·
60 mins
·
(48)
Unity Technologies

In this live session, you will make your driving simulator come alive. First you will write your very first lines of code in C#, changing the vehicle’s position and allowing it to move forward. Next you will add physics components to your objects, allowing them to collide with one another. Lastly, you will learn how to duplicate objects in the hierarchy and position them along the road.
Languages available:
1. Overview
This is the same content covered in Lesson 1.2 in the independent Create with Code Course.
What you will make:
- You will have a moving vehicle with its own C# script and a road full of objects, all of which may collide with each other using physics components.
What you will learn:
- Create C# scripts and apply them to objects
- Use Visual Studio and a few of its basic features
- Write comments to make your code more readable
- Utilize fundamental C# methods and classes like transform.Translate and Vector3
- Add Rigidbody and Collider components to allow objects to collide realistically
- Duplicate objects in the hierarchy to populate your scene
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 - 31st March - 9am PST
If you missed this session, you can catch up with the video below.
4. Recorded Live Session - 31st March - 5pm PST
If you missed this 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 1.2 of the independent Create with Code Course
Optional homework:
- Make stacks of obstacles or combinations of obstacles
- Make the vehicle drive down the road backwards or in the opposite direction down the road
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 1.3 of the independent Create with Code Course