Trigger Particle System Collision

I want to call the particle system routine that Unity calls internally when it collides with something, even if it hasnt colliding with something, i.e. I want to act as if it has collided with something

  1. Missile PS flies along if it hits a wall etc it explodes, i.e. causes #2
  2. it triggers its death routine which creates an explosion particle system
    OK this is all well and good,

but say I want to say to the MissilePS halfway during its flight, selfdestruct, i.e. goto #2
how do I do this?

I suppose I could temporary create an invisible wall, where the missile is, wait for it to collide and then remove the wall, but thats a hacky mess and just bad design, surely its possible to trigger a PS’s death (DestroyObject is not good as it removes it instantly)

I asked this back in 2017 and did not get a satisfactory answer

ignore my last response as I see now its a hack and doesnt work well

thanks zed

What exactly are you asking? When the missile hits the wall it explodes… if you want to cause that to happen at another time, such as at halfway through, or such as when the user hits a key, just map that occurrence to the same terminate-and-explode code.

I think the problem that you’re running into is outside the scope of a Particle System. The missiles should probably be objects instead.

This is probably true. I have used particle systems set to “emit over distance” to make pretty cool bullet streak projectiles however.

Here’s a simple ballistics script:

https://discussions.unity.com/t/809149/3

You can add a raycast to it to see what you hit, or supply a callback to destroy it on demand.

This is what the above particle-streak shots can look like:

https://www.youtube.com/watch?v=Hy0REe835MI