If Scene come to 20 second, first camera change other second camera
i have character. he is walking, but if character walking 20second, camera changed. How can i do?
Answer by Cherno · Jul 20, 2016 at 11:07 AM
public Camera cam1;
public Camera cam2;
void Start() {
StartCoroutine(CamChange());
}
private IEnumerator CamChange() {
return yield new WaitForSeconds(20);
cam1.enabled = false;
cam2.enabled = true;
}
Answer by arbazgillani · Jul 21, 2016 at 05:46 AM
//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; } }
Your answer
![](https://koobas.hobune.stream/wayback/20220612085124im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Making camera move at the same speed as the player but not follow them 0 Answers
How to move camera in x-z axis only for RTS touch script for mobile ? 0 Answers
I need help with my third person camera raycast 0 Answers
Randomly generated moving objects that slowly approach 0 Answers
ClientRpc Function not being carried out on clients in Unity3d c# 0 Answers