I’ve been working with Unity for a long time and now working in a 2D title I’m running in the following issue: my objects are stuttering while I move them, or even if I let them stopped and move the camera. Almost every second! I’m running Unity 4.2.0f4 Pro, with iOS and Android Pro addons.
Clearly it’s not related with the 2D Toolkit plugin that I use, but a Unity problem since you can get the same problem with a simple scene containing a camera and some cubes… start moving the camera at a fixed rate on the Update/FixedUpdate.
I’ve searched about it, found many complains about that and tried most of the solutions discussed in the forums: FixedUpdate, smoothing the Time.deltaTime, Disable VSync, disable dynamic batching… etc… nothing worked =(
In this post http://forum.unity3d.com/threads/135991-Camera-Stutter, Unikron said that Unity guys fixed this kind of issue… but seems like it still exists… did you have any thoughts to workaround this problem or maybe some news on this? ![]()
Just as additional info, running the profiler on the editor I get some spikes on the Render.SetActive() method that matches the timing of the stutter that I see (pictures attached). On Android and W8 devices I get the same problem, but there’s nothing outstanding on the profiler. Also attached a very basic project that shows the problem ( get it here: 1341909–65525–$testProj.zip (23.6 KB) ).
The code attached to the camera is just as simple as :
private float speed = 5.0f;
// Update is called once per frame
void Update () {
Vector3 target = transform.position + new Vector3(speed, 0,0) * Time.deltaTime;
transform.position = Vector3.Lerp(transform.position, target, 20f * Time.deltaTime);
}
or
private float speed = 5.0f;
void Update () {
transform.position += new Vector3(speed, 0,0) * Time.deltaTime;
}
Editor Profiler:
Android Profiler:

