Question by
Dhicci · Apr 08, 2016 at 06:26 PM ·
collisionparticlesystemparticle systemdestroy-clonesspell
destroy particle system on collision
In my game I shoot a fireball (particle system) and I want it to destroy itself (the clone) on collision with any object. The code has no errors, but nothing happens.
public GameObject fireBall;
void Start () {
}
void Update () {
}
void OnParticleCollision(GameObject other)
{
Destroy(fireBall);
}
Comment
Answer by $$anonymous$$ · Apr 09, 2016 at 08:01 AM
Destroy(other.fireBall) If you want pass here link text
I did not get what u said. I am not good with english. And that Destroy(other.fireBall) did not work. I tried this, Destroy(GameObject.fireBall); and it says that Gameobject does not contain a definition fireBall.