Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ParticleCollisionEvent OnParticleCollision
#4
(30-01-2018, 09:29 AM)UTFLuke Wrote: Thx for your answer, its kind of working. The problem i have right now is, that maybe obi fluid is using some kind of object pooling, because my hashset is not getting new values at the size of 1414 everytime. Maybe thats the maxsize of particles in obifluid before it starts reusing old Particles. The problem is that i dont want to hardcode a clear of the hashset at 1414, because i don't really know where that number is coming from. Also performance is getting really bad, as the hashset grows..

Cheers

I don't know how you setup your emitter, but my bet is that the life of some particles is over by the time you start emitting the 1414th one. So the emitter "deletes" the old one, and probably reuses their ID for the newly spawned one as it became available. So in the end, you never have more that 1414 particles at once.
About the hashset solution, it did work in my case because I was doing "one-shot" emission of all the particles and then turning off the spawner, so I wouldn't get a particle reuse some old ID. But if your emitter is continuously generating new ones, and their lifespan is not "infinite", that will probably not work as you would need a more unique ID than the particle ID which is reused.
What is the logic you are trying to achieve?
Reply


Messages In This Thread
RE: ParticleCollisionEvent OnParticleCollision - by tooomg - 30-01-2018, 01:06 PM