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
↧