Hello. I have added a Third Person Controller on my character, and I did not edit the script.
Then I got a NullReferenceException, and it seemed to be on line 129.
Edited code on line 129:
var cameraTransform = Camera.mainCamera.transform;
Code on line 129 before edited:
var cameraTransform = Camera.main.transform;
I edited it to see if it would change if it was a problem with the main camera. However it kept giving me a NullReferenceException.
Do any of you coders have a solution to this?
If so, please answer!
Thanks!
No it got deleted. I made another one and called it Main Camera. with the space in between.
– gamezdragonyeah but it needs the MainCamera tag
– LoiusHow do I add that?
– gamezdragonI cannot believe you asked a whole separate question just to ask "How do I add a tag" : http://answers.unity3d.com/questions/441349/how-to-give-camera-the-maincamera-tag.html Have you heard of google ? : http://www.lmgtfy.com/?q=unity+tag
– AlucardJay