Answer the question
In order to leave comments, you need to log in
Unity: NullReferenceException: Object reference not set to an instance of an object PersonRotation.Update ( ) how to fix?
I wrote this code, used the camera from the standard asset of the unit, then decided to make my own, and made such a mistake, using the camera from the standard asset is not an option. I have some kind of buggy one. PersonRotation is the name of the script itself, and here it is, the error is somewhere on the 14th line. Please explain what is wrong and how to fix it.
Answer the question
In order to leave comments, you need to log in
Do you know what "debugging an application" is? If you knew, you would have no problem finding out that Camera.main contains NULL. And the question would sound "how to mark the camera as the main one."
And all you need to do is select the "MainCamera" tag for the camera
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question