everytime i add → Camera.main.transform.eulerAngles to my script , i always get a NullReferenceException
please help :l
everytime i add → Camera.main.transform.eulerAngles to my script , i always get a NullReferenceException
please help :l
Read the docs about what Camera.main does.
–Eric
Correct me if I’m wrong but camera.main references to the camera component of the camera gameobject, which does not contain a transform component. You might try GameObject.FindWithTag(“MainCamera”) instead
You are wrong steel arm ![]()
The camera component or any component to be accurate has a transform property etc (see Script Reference on the Component class)
the reason this fails potentially is cause
ok i think i understand now , im pretry sure theres no camera taged as main camera , cause it was working b4
, Any tips on taging a camera? :>
That’s what camera.main already does.
Come on, you can figure that out. It’s not hard. ![]()
–Eric
rofl , took me a 30 minutes but i found it xD
sorry for my suckyness , im more of an artist and i just need a place to render my models xD