29-09-2017, 12:01 PM
(This post was last modified: 29-09-2017, 12:02 PM by josemendez.)
(29-09-2017, 10:50 AM)Kalidor Wrote: Hi!
It's me again .
I want to kill a particle on collision.
How can i handle that?
There is a KillParticle method in the emitter, but i'am trying to get the correct index of the particle.
Hi!
You can retrieve it like this:
Code:
solver.particleToActor[contact.particle].indexInActor
contact.particle is the particle index in the entire solver. Since a single solver can manage multiple emitters (i.e. actors) and generally index in solver != index in actor, you can use the particleToActor array to know the particle index in its emitter.
Then you can use KillParticle to kill it.