- Home /
Getting Error Object reference not set to an instance of an object
Hello,
Im getting an error of: 'Object reference not set to an instance of an object' on my MouseLook Script. I Have supplied a picture of the error I'm getting:
This is a picture of the script I'm trying to get working:
If you know how to fix this, Please leave a comment below on how to do so!
Thanks!
Answer by Radon · Aug 06, 2012 at 10:24 PM
In my case, it is usually the below:
You have declared a variable and applied an action to it in the update or start function but did not set what the variable in the inspector is.
You have given an action to a variable inside a function but you have not chosen the object to apply the code to.
$$anonymous$$ake sure that all the variables in your script are set to an object.
Lol, sorry. I'm new to codeing. Do you know how to set variables to objects to get a $$anonymous$$ouseLook script going?
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Need help syntax error 1 Answer
Unity Script Editor Not Working 1 Answer
what is wrong with this online FPS script(not done) ? 1 Answer