Fixed Angles Camera System Part 2

Make Camera Look At Player

In this article we will make the camera look at our player continuously.

To achieve this we created a script “LookAt” and attached it to our main camera. Since our main camera is used constantly, this is the only place it needs to be attached. (Our main camera switches position with the camera system)

After a quick search we found a easy function.

Actually this is all we needed.

[SerializeField] private GameObject _player;

void Update ()
{
transform.LookAt(_player);
}
Assign Player through Inspector

See how when the game is started the camera snaps to the player. Even when the camera position is switched the camera keeps looking at the player.