Hey, Im a beginner and ive written this script for switching from camera1 to camera2 (which is a third person camera) but it dosent work. I need help please.
using UnityEngine;
public class CamSwitch : MonoBehaviour
{
public GameObject cameraOne;
public GameObject cameraTwo;
bool thirdPerson = false;
void Update()
{
//Set camera position 1
if (thirdPerson == false)
{
if (Input.GetKeyDown(KeyCode.C))
{
cameraOne.SetActive(false);
cameraTwo.SetActive(true);
thirdPerson = true;
}
}
//Set camera position 2
if (thirdPerson == true)
{
if (Input.GetKeyDown(KeyCode.C))
{
cameraTwo.SetActive(false);
cameraOne.SetActive(true);
thirdPerson = false;
}
}
}
}