Hello
I wrote this code:
void Update ()
{
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
Debug.DrawRay(ray.origin,ray.direction*10,Color.blue);
RaycastHit hit;
if(Physics.Raycast(ray,out hit)==true)
{
Debug.Log("I am here!!!");
}
and I dont know where the problem is
the console writes me all the time:
NullReferenceException
what I need to fix?
thx for the help