Spawning a particle specific to the surface the original particle collided with?

Hopefully this question hasn’t already been asked, if it has a link to the thread would be most appreciated.

I have a particle system that creates sparks, I am trying to find a way to both spawn more sparks on collision with a hard surface and steam when they hit liquid. I know how to spawn sparks OR steam on collision but I’m looking for a way to do both based on where the particles land. Is it even possible?

Thanks!

I can’t say for sure without trying it, but we’ve had a chat about this here, and think that you should try this:

  • Enable Send Collision Messages on the Collision Module
  • Add OnParticleCollision to a script attached to the GameObjects that you are colliding with
  • Call GetCollisionEvents to get the particles that are hitting that collider
  • For each one, call ParticleSystem.Emit on the emitter you want to spawn. Take a look at the EmitParams structure, where you can override the position of the new particles

Unity - Scripting API: EmitParams (position and applyShapeToPosition should be useful!)

1 Like

We’ll look into that, thank you, much appreciated! If we get it working i’ll post here again with the results.

2 Likes