Run the following code ,only 2 line.it cannot work But I get the error:NullReferenceException: Object reference not set to an instance of an object.
How can I get reason? help me,Thanx!
function Update () {
var ray = Camera.main.ScreenPointToRay (Input.mousePosition);
Debug.DrawRay (ray.origin, ray.direction * 10, Color.yellow);
}