September 2013
Beginner
292 pages
6h 19m
English
This camera script has three added lines of code to make the camera move as Player moves.
Attach this script to Following Camera in the Hierarchy panel:

An analysis of the code shown in the preceding screenshot is as follows:
Line 6: public float cameraHeight = 17.0f;
cameraHeight stores the distance the camera will be above PlayerLine 7: public float cameraDistance = 17.0f;
cameraDistance stores the distance the camera will be away from Player on the x and z axesLine 18: transform.position = playerPosition.position +
new Vector3(cameraDistance, ...