how to get a camera to follow a object in a 2d game unity code example
Example: how to make a camera follow an object in unity 2d
public Transform player; public Vector3 offset; void Update () { transform.position = new Vector3 (player.position.x + offset.x, player.position.y + offset.y, offset.z); // Camera follows the player with specified offset position }