When I shoot the object that’s being exploded I get prefab_explosion (cloned) where the object was destroyed. I’ve googled and googled and tried what I’ve already learned and I can’t seem to get rid of these objects
var bulletSpeed : float = 15.0; //speed of the bullet
var heightLimit : float = 10.0; //range the bullet can travel
var explosion : Transform;
function Update ()
{
transform.Translate(0,bulletSpeed * Time.deltaTime,0);
if(transform.position.y >= heightLimit){
Destroy (gameObject);
}
}
function OnTriggerEnter (other : Collider)
{
//check for the astroid
if(other.gameObject.tag == "astroid"){
Destroy(gameObject);
other.transform.position.y = 7;
other.transform.position.x = Random.Range (-5.7, 5.7);
//create the explostion on impact
Instantiate (explosion, transform.position, transform.rotation);
}
Did the job! Thank you
– systmfdwn147I am glad that I could help.
– Chronos-L