i have character. he is walking, but if character walking 20second, camera changed. How can i do? [74403-adsızq.png|74403]
public Camera cam1;
public Camera cam2;
void Start() {
StartCoroutine(CamChange());
}
private IEnumerator CamChange() {
return yield new WaitForSeconds(20);
cam1.enabled = false;
cam2.enabled = true;
}
//Make your camera’s child of two empty game objects and pass the reference of those camera’s in this //script
public GameObject cam1;
public GameObject cam2;
bool check=false;
void Start() {
StartCoroutine(“ChangeCamera”);
}
IEnumerator ChangeCamera() {
return yield new WaitForSeconds(20);
if(check){
cam1.SetActive(false);
cam2.SetActive(true);
check=false;
}
else
{
cam1.SetActive(true);
cam2.SetActive(false)
check=true;
}
}