Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

Object referance not set to an instance of an object?

$
0
0
I am using a raycast script but it says "Null Referance Exeption Object referance not set to an instance of an object", and doesn't print anything How do i fix this function Update () { var foundHit : boolean = false; var hit : RaycastHit; if (Input.GetButton("Fire1")){ if (Physics.Raycast(transform.positon, transform.forward)) print("YES"); else print("NO"); } }

Viewing all articles
Browse latest Browse all 2891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>