Quantcast
Channel: Latest Questions by Wrymnn
Viewing all articles
Browse latest Browse all 131

Instantiate with parameter not working

$
0
0
Explain me this DARK magic why is this not working ang giving me error: //Ignore random spawn position in instantiate its not relevant GameObject ship = Instantiate(spawnableShip_01,new Vector3(transform.position.x + Random.Range(-5,5),transform.position.y + Random.Range(-5,5),0),Quaternion.identity) as GameObject; ship.GetComponent().cameFromStargate = true; It will even spawn that stupid ship and then always always no matter how else I set it: NullReferenceException: Object reference not set to an instance of an object

Viewing all articles
Browse latest Browse all 131

Trending Articles



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