We are attempting to build simple multiplatform 2d games but have noticed that the animation within unity is not as smooth as we would like. When compiled to either a stand alone executable or webplayer we have noticed pauses and skips in object translation and UV scrolling. We have tested this on a number of windows and mac machines and so far only one of the machines has consistantly performed well.
As a test I have built a simple project in an attempt to reduce the number of variables in the problem. The project only consists of a plane with a texture that is animated by UV scrolling. This example is at it’s core just one line of code in update:
material.mainTextureOffset += velocity * Time.deltaTime;
where material is cached version of this.renderer.material and velocity is a public variable. I have included a link to the project if you would like to take a look.
http://dl.dropbox.com/u/22825039/SimpleUV.zip
I have poked around and have noticed that the deltaTime between frames varies wildly. I wrote a script to investigate this (not included) and found that I was getting the occasional blip that was nearly 3 or 4 times the average. The windows machine usually maintained a deltaTime between 0.045s and 0.005. On the mac the results were more interesting and puzzling as the deltaTime fluctuated constantly between 0.016s and 0.017s with only an occasional spike.
just a few more notes:
- fullscreen appears to run slightly better
- webplayer is by far the worse
- Vsync has little or no affect
- TargetFramerate has little or no affect
- remove the plane and UV scrolling and the deltaTime still fluxuates
- profiler has the occsional spike in other
so, ultimately my question is this: what is going on? Is unity3d this unstable?