Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Best way to remove particles at runtime
#2
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

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;
Reply


Messages In This Thread
RE: Best way to remove particles at runtime - by josemendez - 16-12-2020, 08:15 PM