16-12-2020, 08:15 PM
(This post was last modified: 16-12-2020, 08:15 PM by josemendez.)
The indices provided by contacts are solver indices. You need to convert them to actor indices first, as per the docs:
http://obi.virtualmethodstudio.com/tutor...sions.html
http://obi.virtualmethodstudio.com/tutor...sions.html
Quote:IndexInActor
The index of this particle in the actor's arrays. For instance, you can kill a ObiEmitter particle upon collision by doing this:
Quote:ObiSolver.ParticleInActor pa = solver.particleToActor[contact.particle];
ObiEmitter emitter = pa.actor as ObiEmitter;
if (emitter != null)
emitter.life[pa.indexInActor] = 0;