Hello everyone! I'm having some trouble trying to advance my particle system when it loads so it doesn't need a "warm up" period. Looking at the forum everyone seems to recommend trying particleEmitter.Simulate(). I have a particle system set up and working in my scene, and have attached a javascript file to it with the following, very modest test. Code (csharp): function Start () { particleEmitter.Simulate(stepSize); } In return, unity says: Assets/scripts/particleJumpStart.js(2,23): BCE0019: 'Simulate' is not a member of 'UnityEngine.ParticleEmitter'. I would use the time scale trick some people have written about, but it needs to run for a second when set to 99 so it looks pretty silly until it's ready Thank you so much for any assistance you can provide - this is confusing the heck outta me. -Chris
you need to set up something like this Code (csharp): var Emitter : ParticleEmitter; var time : float = 1.0; function Start () { Emitter.Simulate(time); } and then select which particle emitter you need to simulate. I also have some problems getting this to work though, seems like the simulate doesn't work with larger values. unity answer recommended: Code (csharp): for (i = 0; i < warmupTime; i++) { particleEmitter.Simulate(1.0); }
just tested it, this works for me: Code (csharp): var Emitter : ParticleEmitter; var time : float ; function Start () { for (i = 0; i < time; i++) { Emitter.Simulate(1.0); } }
No, chrisw's code is correct. Just use particleEmitter.Simulate. It's not available in Unity iPhone. --Eric
fair enough, I'm not a real programmer but I usually get that error whenever I need to define a specific component
Aw crud - so just no go on the iPhone huh? I tried the time scale solution as a substitute. When it's simulating in unity it works fine, but it freaks out in the compiled app running on the iPhone. Another solution I tried was sending out a burst of particles in the Awake at a high speed and then in the Start setting the emitter parameters back to normal. The problem I had with this solution was that I couldn't get the first burst to slow down. I tried targeting them by looping through the particleEmitter.particles array and setting their velocity.x to a lower number, but it doesn't work - they just fly off into oblivion. Are there any other workarounds that I should try? Thank you very much for the input Eric and Pirate -- I really appreciate the assistance!
Ah well, I came up with a less processor intenstive solution anyway, so maybe it was for the best Thanks again for the help!