- Home /
Question by
charnew · Feb 09, 2012 at 09:21 AM ·
instantiatedestroyoncollisionenter
destroy an instantiated object from oncollision enter
destroy an instantiated object from oncollision enter of an object in the oncollision enter of another object
here's my script
if(theCollision.gameObject.name == "explosive")
{
boom= Instantiate(fire, transform.position, transform.rotation);
boom.transform.parent = transform;
boom.rigidbody.position.x += Random.Range(0.0f, 0.3f);
boom.rigidbody.position.y += Random.Range(0.0f, 0.3f);
}
else if(theCollision.gameObject.name == "mutant")
{
Destroy(boom, 1);
}
Comment
Your answer
Follow this Question
Related Questions
I want to A(enemy) touch B. Then B change to C 2 Answers
Guided Missiles help? 2 Answers
Problems destroying object on collision with Terrain 3 Answers