Obi Official Forum

Full Version: I want to know the times.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm scattering 5,000 water particles on the floor.
every single 5,000 water particles, from the emitter to hitting the floor, are taken time. so i want to know the times one by one.
To sum up, I would like to know the time it took from the time 5,000 water particles were collided to the floor (total a number of 5,000 times).
I think i should write a script in 'CollisionEventHandler', and I'd like to know how to do it. Huh
(21-11-2020, 05:29 PM)dabinzzang Wrote: [ -> ]I'm scattering 5,000 water particles on the floor.
every single 5,000 water particles, from the emitter to hitting the floor, are taken time. so i want to know the times one by one.
To sum up, I would like to know the time it took from the time 5,000 water particles were collided to the floor (total a number of 5,000 times).
I think i should write a script in 'CollisionEventHandler', and I'd like to know how to do it. Huh

Hi there,

This is a basic programming question, not really Obi-specific.

You should keep some kind of timer for each particle (lots of options here: accumulate Time.fixedDeltaTime, take a difference of two measures of Time.time, etc). Start counting time when a particle is spawned (you can use emitter's OnEmitParticle event for this) and stop it when the particle hits the floor collider.

Depending on your needs, you could also keep a single timer: start counting when the first particle is emitted and stop counting when the last one hits the collider.