I have an extremely simple project - 1 directional light, 1 cube with Default-Diffuse material on it and 1 camera. Camera points at cube and cube has the following script on it:
void Update () {
transform.Rotate(0, Time.deltaTime*10, Time.deltaTime*20);
}
That’s all there is to it… Deploying to iOS, I get a nicely spinning cube as expected… But every 10 seconds or so, it gets choppy - skipping a handful of frames. Since there is almost nothing going on, I am guessing that either there are background processes in Unity messing things up or the OS itself is doing something that prevents smooth consistent animation.
Here is the relevant profiler output…
----------------------------------------
iPhone Unity internal profiler stats:
cpu-player> min: 1.1 max: 2.9 avg: 1.4
cpu-ogles-drv> min: 0.1 max: 0.3 avg: 0.1
frametime> min: 27.3 max: 38.4 avg: 33.4
draw-call #> min: 1 max: 1 avg: 1 | batched: 0
tris #> min: 12 max: 12 avg: 12 | batched: 0
verts #> min: 24 max: 24 avg: 24 | batched: 0
player-detail> physx: 0.4 animation: 0.0 culling 0.0 skinning: 0.0 batching: 0.0 render: -1.0 fixed-update-count: 1 .. 2
mono-scripts> update: 0.1 fixedUpdate: 0.0 coroutines: 0.0
mono-memory> used heap: 188416 allocated heap: 200704 max number of collections: 0 collection total duration: 0.0
----------------------------------------
iPhone Unity internal profiler stats:
cpu-player> min: 1.2 max: 3.8 avg: 1.5
cpu-ogles-drv> min: 0.1 max: 0.6 avg: 0.1
frametime> min: 26.3 max: 207.8 avg: 38.9
draw-call #> min: 1 max: 1 avg: 1 | batched: 0
tris #> min: 12 max: 12 avg: 12 | batched: 0
verts #> min: 24 max: 24 avg: 24 | batched: 0
player-detail> physx: 0.4 animation: 0.0 culling 0.0 skinning: 0.0 batching: 0.0 render: -0.9 fixed-update-count: 1 .. 10
mono-scripts> update: 0.1 fixedUpdate: 0.0 coroutines: 0.0
mono-memory> used heap: 188416 allocated heap: 200704 max number of collections: 0 collection total duration: 0.0
----------------------------------------
iPhone Unity internal profiler stats:
cpu-player> min: 1.2 max: 2.9 avg: 1.5
cpu-ogles-drv> min: 0.1 max: 0.1 avg: 0.1
frametime> min: 20.0 max: 138.8 avg: 38.3
draw-call #> min: 1 max: 1 avg: 1 | batched: 0
tris #> min: 12 max: 12 avg: 12 | batched: 0
verts #> min: 24 max: 24 avg: 24 | batched: 0
player-detail> physx: 0.4 animation: 0.0 culling 0.0 skinning: 0.0 batching: 0.0 render: -0.9 fixed-update-count: 1 .. 7
mono-scripts> update: 0.1 fixedUpdate: 0.0 coroutines: 0.0
mono-memory> used heap: 188416 allocated heap: 200704 max number of collections: 0 collection total duration: 0.0
----------------------------------------
iPhone Unity internal profiler stats:
cpu-player> min: 1.1 max: 2.3 avg: 1.3
cpu-ogles-drv> min: 0.1 max: 0.1 avg: 0.1
frametime> min: 29.0 max: 38.1 avg: 33.4
draw-call #> min: 1 max: 1 avg: 1 | batched: 0
tris #> min: 12 max: 12 avg: 12 | batched: 0
verts #> min: 24 max: 24 avg: 24 | batched: 0
player-detail> physx: 0.4 animation: 0.0 culling 0.0 skinning: 0.0 batching: 0.0 render: -1.1 fixed-update-count: 1 .. 2
mono-scripts> update: 0.1 fixedUpdate: 0.0 coroutines: 0.0
mono-memory> used heap: 188416 allocated heap: 200704 max number of collections: 0 collection total duration: 0.0
----------------------------------------
The first set of stats is what you’d expect, but in the second the frametime max is 207.8 ms - a full 1/5th of a second - a very noticable pause in the animation. The third set of stats again has a slow frame at 138.8 ms. At the fourth, everything is back to normal again and it will continue that way for another 10 seconds or so.
Is everyone else seeing this also? I’m using Unity Pro with Unity iOS (not iOS Pro) deploying to an iPhone 4. I get this even if I reboot the iPhone and ensure no other apps are running. Haven’t tried resetting my iPhone to factory defaults yet, but I am hoping that there is indeed something unique to my phone and this is not a real problem.
Thanks for reading - any experience you can share this issue (or lack thereof if you’ve never seen it) would be appreciated.