Week 2 | Session 3 - Make the Camera Follow - Apr 1, 2020
Tutorial
·
Beginner
·
+10XP
·
60 mins
·
(46)
Unity Technologies

Keep your eyes on the road! In this live learning session you will code a new C# script for your camera, which will allow it to follow the vehicle down the road and give the player a proper view of the scene. In order to do this, you’ll have to use a very important concept in programming: variables.
1. Overview
This is the same content covered in Lesson 1.3 in the independent Create with Code Course.
What you will make:
- The camera will follow the vehicle down the road through the scene, allowing the player to see where it’s going.
What you will learn:
- Declare variables properly and understand that variables can be different data types (float, Vector3, GameObject)
- Initialize/assign variables through code or through the inspector to set them with appropriate values
- Use appropriate access modifiers (public/private) for your variables in order to make them easier to change in the inspector
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 - 1st April - 9am PST
If you missed this session, you can catch up with the video below.
4. Recorded Live Session - 1st April - 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.3 of the independent Create with Code Course
Optional homework:
- Make a new camera that looks through the driver’s windshield
(you may have to do some Googling)
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.4 of the independent Create with Code Course