September 2013
Beginner
292 pages
6h 19m
English
This simple script makes the camera look at Player. The camera does not move. It simply rotates so it's always looking at Player no matter how close or far away it is.
Attach this script to LookAt Camera in the Hierarchy panel:

Let us analyze the code that we just saw:
Line 6: private Transform playerPosition;
playerPosition will store the Transform information of PlayerTransform x, y, z position of Player is updated and stored in the variable playerPositionLine 10: playerPosition = GameObject.Find("Player").transform;