- Home /
How to enable/disable Particle System Prewarm through code
Hi, I need to be able to set prewarm enabled/disabled through code(c#) on instantiation of a particle system. I just cant find how to access prewarm. I know it is part of particle system but for the life of me I cant find it. Any help would be much appreciated.
Thanks!
I just want to clarify what Im needing to happen here: I have a rain particle system prefab. I have it so that I can set the intensity(emission rate) of the system when it is instantiated. I had prewarm ticked. That works fine for heavy rain, the level beings and it is already raining. However when there is only light rain, there is an initial flurry or rain, then that clears to light rain. To fix that I needed to turn off prewarm. Hence I need to be able to switch prewarm on and off through code.
I did try instantiating with prewarm off and using this: ps.Simulate(ps.duration); However that does not work. It creates an initial spurt of rain, but that rain seems to hang in midair and then no more rain falls. So if looks like it runs the particle system for turn and then stops. (I do have the particle system set to loop).
Answer by superflyninja · Jul 11, 2016 at 06:54 PM
Edit : I was missing something. Ok so there is no way to directly access preawrm. but instead to use
ps.Simulate(ps.duration);
thanks :D
Hmmm actually that doesnt work in the same way. It does start the particle system, but it stops and then doesnt enable at all.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
how can I get particle.position out of shuriken system? 2 Answers