Beginner Scripting: Look At


In this weeks Coding Task it was showing how to use the Look At function to follow a target with the camera. Whats nice about this weeks task was as I was watching it I thought to myself that after creating the script I now have to tell the camera what the 'target' is in the inspector and I was right it was the next step. This shows I am understanding Unity more and more as the weeks go on.

The script is as follows;


public class CameraLookAt : MonoBehaviour { public Transform target; void Update () { transform.LookAt(target); } }

Comments

Popular Posts