Quantcast
Channel: Latest Questions by zeuo
Viewing all articles
Browse latest Browse all 90

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

$
0
0
this is driving me crazy can anyone give me any help please. the error is online 37 in var childcam: Camera var rocketpref:Transform; var shoottimer: float = 0; var shootcooler: float = 0.9; function OnGUI() { if(shoottimer> 0){ shoottimer -=0.2* Time.deltaTime * 10; } if(shoottimer < 0){ shoottimer = 0; } //Fire button if (GUI.Button(Rect(450,280,80,80),"Rockets")) { if(shoottimer ==0){ var bullit = Instantiate(rocketpref, GameObject.Find("rs").transform.position, Quaternion.identity); shoottimer = shootcooler; } } if (GUI.Button(Rect(350,280,80,80),"cam")) { var childCam : Camera = bullit.GetComponentInChildren(Camera); childCam.enabled =false; } }

Viewing all articles
Browse latest Browse all 90

Trending Articles



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