Project
Roll-a-ball
Camera and Play Area
Tutorial
Beginner
10 Mins
Unity Technologies
Overview
Overview
You have completed 0% of this Tutorial.
1.
Moving the Camera
2.
Setting up the Play Area
Summary
The Roll-a-ball Project is a simple rolling ball game that teaches you many of the principles of working with Unity.
The 3rd of 4 tutorials in the project shows how to move the camera relative to the player, and set up the play area with walls so that the ball will not fall off the platform.
Roll-a-ball tutorials:
  1. Introduction to Roll-a-ball
  2. Environment and Player
  3. Camera and Play Area
  4. Collecting, Scoring, and Building the Game
Language
English
Recommended Unity Versions
5 and Above
1.
Moving the Camera
Moving the camera relative to the player.

CameraController

using UnityEngine; using System.Collections; public class CameraController : MonoBehaviour { public GameObject player; private Vector3 offset; void Start () { offset = transform.position - player.transform.position; } void LateUpdate () { transform.position = player.transform.position + offset; } }

2.
Setting up the Play Area
Setting up the play area.

Woohoo! You nailed this tutorial.
Continue rocking your Roll-a-ball project.
Next Step:
Collecting, Scoring and Building the Game
Tutorial
Beginner
45 Mins
Unity Technologies
Part of: