The question is answered, right answer was accepted
Please help can't find what is causing this error
hi!
i'm not an expert in unity and i got this error in my project.
I searched on google and all i could find was that it is because something is missing??
but i don't know what's wrong in my script
the error i get: ( NullReferenceException: Object reference not set to an instance of an object GameMaster.Update() (at Assets/GameMaster.cs:18) )
the script:
Answer by NvGBoink · Nov 16, 2015 at 01:42 PM
Camera.main is a gameObject referance to a camera object with the "MainCamera" tag.
Make sure you have tagged the camera with "MainCamera"
Or make a public GameObject variable and drag drop the camera into the inspector.
thanks this worked :), now i still need to figure out how i can add a price everytime i click on a object
Follow this Question
Related Questions
How Can I Detect Objets on Click with Raycast? 0 Answers
Raycast hitting air 0 Answers
Raycast from camera only working from certain angles 1 Answer
Movement Unit (RTS) 0 Answers
Raycast from Camera 0 Answers