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

NullReferenceException:Object reference not set to an instance of an object

$
0
0
I create a menu of game script: var quit=false; function OnMouseEnter() { GetComponent.renderer.material.color = Color.red; //Change Color to red! } function OnMouseExit() { GetComponent.renderer.material.color = Color.white; //Change Color to white! } function OnMouseUp() { if (quit == true) { Application.Quit(); //If you click on quit aplication quits. } else { Application.LoadLevel(1); //If you click on other button if loads game! } } function Update() { if (Input.GetKey(KeyCode.Escape)) //If you press (escape) game force closes! { Application.Quit(); } } and when I get into game mode error occurs: NullReferenceException: Object reference not set to instance of year year object.Please help

Viewing all articles
Browse latest Browse all 7934

Trending Articles



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