- Home /
Mobile: Playing particle effect for the first time, system lags
I have a simple game where the user has to type with the virtual keyboard and everytime a key is pressed, the particle System is played. The first time its played, the particle system makes the game lag, after that it plays smooth.
Is there a way to preload it? I tried playing the particle system before the key is pressed, but that doesn't fix the issue, does anybody have experience with this?
Additional information: I'm not instantiating the particle system, I have just placed it in my scene and ".Play()" it.
I'm having the same issue. It did not begin to occur until I added a ~30k poly 3ds max character w/ animated biped and some C# changes, maybe a new layer...other than that I can't think of what else changed.
Oh, actually, I did mess around with loading code at some point (duh). I was just using Scene$$anonymous$$anager.LoadScene("name") originally but I did change it - am not at the workstation now but will follow up on this when I get the chance.
Answer by HarshadK · May 28, 2015 at 11:25 AM
If your particle system set to be 'Looping' then you can select the 'Prewarm' option.
Sadly in my game the looping is not needed, the particles should play after the users clicks on a button.
If it occurs on the first load only then try to play and stop the particle system in the Start() method.
I tried playing the particle system when the scene loads but it doesn't help, there is still the lag the first time I click the button, though after that, it runs smoothly. Though I haven't try to "stop" it, will test it and get back to you :)
I restructured my project (having multiple scenes $$anonymous$$ENU, GA$$anonymous$$E, GA$$anonymous$$EOVER) and for some reason it works now (without adding the .stop method). This question is probably not very useful for anybody encountering the issue as the problem solved itself :/
I have the problem in Unity 5.3, so I still think there is some pooling problem in the Play-method of the ParticleSystem class.
Your answer
Follow this Question
Related Questions
performance question about particles and instantiating 1 Answer
Buttons take time to be fully charged at startup 0 Answers
Performance problems on Android (apk) 1 Answer
Android app is laggy 1 Answer
GoogleVR vs GearVR - frame dropping 0 Answers