Im making an asteroids game and am trying to Instantiate four prefabs in space surrounding an asteroid everytime i shoot it though evertime i try to do this i destroy the asteroid and Instantiate four asteroids surrounding my space ship.
this is my code for Instantiating my objects ![]()
if(hit.rigidbody.gameObject.name == "AsteroidA"){
for (var i : int = 0;i < 4; i++)
Instantiate (gameObject.Find("AsteroidA"),Random.insideUnitSphere *8 +transform.position,Random.rotation);
}