I'm a bit confused by this. I've got a particle system as a prefab, and I only want it to appear in the scene when a collision happens with the player. I also want it to appear in the same place as the player like the player has exploded. Here's what I have so far, forgive me if this is way off:
public class particleManager : MonoBehaviour {
public ParticleSystem explosion;
public bool emittingParticles = false;
public void Update () {
if (emittingParticles == true) {
explosion.enableEmission = true;
}
}
}
void OnCollisionEnter2D (Collision2D col) {
if (col.gameObject.tag == "enemyPlanet") {
particles.emittingParticles = true;
}
}
Am I on the right lines here? How do I instantiate the particle?