Using a second camera and finding it using a tag
I have created an camera which i want to be activated on certain instances when i go to a scene. I start off in a different scene then i change my scene which works perfectly fine. Then i have a camera with a tag i created called OverviewCam. However when i run my program i get the error
NullReferenceException: Object reference not set to an instance of an object
My code for setting the camera is
Camera OverviewCam;
OverviewCam = GameObject.FindGameObjectWithTag("OverviewCam").GetComponent<Camera>() as Camera;
Anyone know how to fix this or another way to allow me to change cameras when going to a scene a certain way
Your answer
![](https://koobas.hobune.stream/wayback/20220612172453im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
uNet hitboxes and movement. 0 Answers
How to do a wall jump? i am very novice 0 Answers
Third person camera collision problem 0 Answers
Camera keeps going behind walls/floor 1 Answer
How can I make a third person camera collision script? 2 Answers