I’ve already posted this in Unity Answers, but I figured you guys may be able to help because this is Android specific. If posting on both isn’t allowed I’ll take it down.
My game plays fine in editor, desktop, and web; however, when I run it on my Android phone it has a framerate jitter that lasts a fraction of a second every 5 to 7 seconds or so. The jitter doesn’t seem to be correlated to any specific part of the game. It happens when a lot of physics calculations are going on, and while all of the rigibodies and colliders are removed.
I have tested my game on my Droid X, 1GHZ OMAPP CPU, and an EVO 4G, 1GHZ Snapdragon CPU. Spare the jitters, the frame rate stays at a constant range of 60 to 70 FPS.
On a last note, I am using the trial version of Unity Android. I’d be happy to hear this issue only comes up in the trial version.
Yea, I’d bet on the garbage collection too. If it’s not OnGUI stuff, then your scripts are probably bad written (i.e many allocations in Update/FixedUpdate methods or any methods which are called from there).
You should avoid unnecessary file allocations inside of these methods (same goes for loops too). if you have Unity Pro (or enabled the Trial) look at the Profiler what’s causing it.
I am using several in fact. I have a fuel level indicator, composed of 3 parts, and a pause button.
What would be a good alternative, GUITextures?
I’ve looked at the profiler as it runs and I see a lot of spikes, but they are all at a constant pace, and don’t line up with the jitters. I’ll check again when I get home, though.