hi,I am getting error report as"Null reference Exception:Object reference not set to an instance of an object",Error from the line in BOLD format…Plz help:face_with_spiral_eyes:
Void update()
{
if(_c==true )
{
RayProductn();//production of ray and show at manager , the way where we can move the cube
}
}
public void RayProductn()
{
Debug.Log(“Inside RayChk _CurrentObject”+ _CurrentObject);
// Debug.Log(“ob”+_CurrentObject.name);
Ray ray1 = new Ray(_CurrentObject.position,_CurrentObject.transform.right );//produce ray in 4 directions
Ray ray2 = new Ray(_CurrentObject.position,_CurrentObject.transform.right* -1);
Ray ray3 = new Ray(_CurrentObject.position,_CurrentObject.transform.up*-1);
Ray ray4 = new Ray(_CurrentObject.position,_CurrentObject.transform.up);
Debug.DrawRay(ray1.origin,ray1.direction,Color.red);
Debug.DrawRay(ray2.origin,ray2.direction,Color.red);
Debug.DrawRay(ray3.origin,ray3.direction,Color.red);
Debug.DrawRay(ray4.origin,ray4.direction,Color.red);
}