How to calculate a particle's potential maximum total velocity?

Hopefully this makes sense.
I’m trying to work out what an emitted particle’s maximum velocity.magnitude could be.
I have a particle system prefab from Unity’s asset pack with a collider surrounding the emitter. A script is attached to the collider that basically iterates through the list of collision events of the emitted particles and in this case gets the particle’s “totalVelocity.sqrMagnitude”.

flameTriggerData[flameTriggerDataIDX].sqrMagnitude = p.totalVelocity.sqrMagnitude;

“p” being an emitted particle that has collided with the collider.

This works fine, but I’m aiming to then normalise these values between the range of 0.0 - 1.0, in which case I need the maximum possible value.
With particle.totalVelocity being the sum of particle.velocity and particle.animatedVelocity I’m not sure what values/parameters in the particle system modules to take into account. The manual gives some examples but doesn’t seem the note all modules that have an effect on totalVelocity.

Particle System modules

Anyone know the best method to work this max value out?

Thanks.

Any module that moves the particles, will affect the value. Velocity over life, force over life, velocity by speed, limit velocity, noise, collision… and a few settings in the main module.

Some modules eg collision and limit velocity only reduce the speed, you may wish to ignore those.

It’s probably quite hard to calculate the max possible speed robustly by inspecting these properties, perhaps consider running an offline script in your build process to simulate the systems and record the max speed. Then save that value with each system? Just a thought :slight_smile: