Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Counting total particles into bucket
#1
Hi,

Using the Obi Fluid faucet and bucket example but with a lifespan of say 5 on the particles, how would I go about counting the total particles that have entered the bucket?  This would include the particle count after the lifespan of the current particles expire and new particles are generated.  Basically what I'm trying to do is allow the user to move the bucket and calculate a score based on how many particles enter the bucket in total.  The liquid stream may come in bursts (e.g. 500 in 1 second, then the particles are expired and another round comes a few seconds later), or it may be a constant stream but just 500 active particles at any one time.

So if they catch all the particles in the first stream I want the score to be 500, then those particles expire, and if they catch all the particles in the second stream the score would be 1000.

I've used the collider example and tested if the collider is the bucket, which gives me a current total count in the bucket.  Because the ID of the particles are reused when the expire, I can't keep a list of all particle IDs that have collided with the bucket.

Is there some sort of OnExpire event I can hook in to?  This way I could check at expire time if the particle is colliding with the bucket and add 1 to the overall score.

Thanks.
Reply


Messages In This Thread
Counting total particles into bucket - by FamilyGamesTime - 09-10-2018, 03:29 AM