hello
i know this question been asked a lot but i couldn’t find a clear answer and i really don’t want to change this script so idk what’s wrong with this script am using [it goes find after selecting the cameras but when i switch to 3rd person it goes back to first]
*sorry kind of learning here
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ChangPOV : MonoBehaviour
{
public Transform Player;
public Camera FirstPersonCam;
public Camera ThirdPersonCam;
public KeyCode Key;
void Start()
{
ThirdPersonCam.gameObject.SetActive(false);
FirstPersonCam.gameObject.SetActive(true);
}
void Update()
{
if (Input.GetKeyDown(Key))
{
FirstPersonCam.gameObject.SetActive(false);
ThirdPersonCam.gameObject.SetActive(true);
}
else
{
FirstPersonCam.gameObject.SetActive(true);
ThirdPersonCam.gameObject.SetActive(false);
}
}
}
public class ChangPOV : MonoBehaviour
{
public Transform Player;
public Camera FirstPersonCam, ThirdPersonCam;
public KeyCode TKey;
public bool camSwitch = false;
void Update()
{
if (Input.GetKeyDown(TKey))
{
camSwitch = !camSwitch;
FirstPersonCam.gameObject.SetActive(camSwitch);
ThirdPersonCam.gameObject.SetActive(!camSwitch);
}
}
}