- Home /
How to read both "Random between two constants" values in ParticleSystem?
Whenever I read it through ParticleSystem.startSize I seem to only get the max value. How to I read both?
Please provide the line of code, where you get only the max value.
Answer by Owen-Reynolds · Jul 16, 2014 at 04:27 AM
Not really an answer but, you probably can't access the fancy particleSystem vars from script.
The old particle system was known for having a few things you just couldn't access in script. I'd guess the new one is also that way, and what you see (in the script reference) is what you get. It sort of makes sense that StartLife would, as sort of a hack, return Max in RandomBetween. I often use that to wait for all particles to die, when the Max is what you want.
I just thought it should be possible with the right cast, so I asked the OP the line of code that gets only the max value.
particleSystem.startLifetime
returns a float, so it's not like you can do any tricks to get a second value out of it.
Sure, if StartLifetime returned a Vector2, then maybe javascript would fix float life = myPS.startLifetime
by adding dot-y at the end. So you'd falsely think it only returned the max.