How can I set up cameras to track the player from room to room?

I’ve implemented player movement, as well as three different rooms. I understand how to create a first and third person camera, but how can I make three different camera views to track the player from room to room?
More specifically, is there a way to zoom in on each room when the corresponding button is clicked?

So far I have a separate script attached to the main camera with this code:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class cameraControls : MonoBehaviour
{
    public GameObject player;
    //private Vector3 offset;
    public bool greenRoom;
    public bool blueRoom;
    public bool purpleRoom;


    void OnGUI()
    {
        // Room 1 (Green room)
        if (GUI.Button(new Rect(20, 50, 140, 40), "Green Room Camera"))
        {
            greenRoom = true;
            blueRoom = false;
            purpleRoom = false;
        }

        // Room 2 (Blue room)
        if (GUI.Button(new Rect(20, 110, 140, 40), "Blue Room Camera"))
        {
            blueRoom = true;
            greenRoom = false;
            purpleRoom = false;
        }

        // Room 3 (Purple room)
        if (GUI.Button(new Rect(20, 110, 140, 40), "Purple Room Camera"))
        {
            blueRoom = false;
            greenRoom = false;
            purpleRoom = true;
        }
    }

    // Start is called before the first frame update
    void Start()
    {
        //offset = transform.position - player.transform.position;
    }

    // Update is called once per frame
    void Update()
    {
        if (greenRoom == true && blueRoom == false && purpleRoom == false)
        {
        }

        if (blueRoom == true && greenRoom == false && purpleRoom == false)
        {
        }

        if (purpleRoom == true && blueRoom == false && greenRoom == false)
        {
        }
    }

}

  1. triggers delineating which area/room should use which camera (position).
  2. empty transforms as “placeholders” for the camera positions
  3. script on triggers - if player enters this trigger/group of triggers, the assigned empty transform will be used as new position for main camera
  4. that should be all.
  5. You’re welcome, have a nice day :slight_smile: