Particle System Start Delay

I’m playing around with a fire particle system (p) that I downloaded from the Asset Store. Unity (5.6) gives me a warning that p.startDelay is now obsolete, and that I should now use main.startDelay. While I can set the value of the delay (main.startDelay = 0.1f) without problem, when I try to compare the start value (main.startDelay == 0f), Visual Studio gives me an error message saying that “Operator ‘==’ cannot be applied to operands of type ‘ParticleSystem.MinMaxCurve’ and ‘float’”. Interestingly enough, the obsolete code (p.startDelay == 0f) does not produce an error. I’ve been through the docs a number of times, but I can’t find an example of where they compare the values; they only set the value, which works for me as well. So, can anyone figure out why I can set startDelay to a float, but I cannot compare it to a float?

You’re probably looking for:

main.startDelay.constant

main.startDelay is a MinMaxCurve, not a float. I’m guessing they have an operator overload for setting it to a float value, which is why the “= 0.1f” worked but the equality operator didn’t.

1 Like

Yes, that fixed it, thank you! Is it just me, or is documentation on this hard to find?

P.S. This forum is awesome!

Documentation on it is here.

You can search for stuff on the Scripting Reference page, the little expandable hierarchy on the left contains all of the info on classes you need. Most of the time though I just google “unity [classname]”, it’s generally faster.

Thank you. Very much appreciated.

No problemo =)