- Home /
Movement lag, jitery every few seconds
I made a game in Unity where an apples falling from top to bottom. The problem is that they don't fall smoothly. In every seconds they move crappy like this:
down, down, down, UP, down, down, down ,UP, down, down, down...
Looks like in every few seconds object jumps up and then falling like it should do and then again jumps up...
The code is very simple:
function Update () {
transform.position.y -= speed * Time.deltaTime;
}
I tried turning off VSync, tried FixedUpdate(with Time.fixedDeltaTime), LateUpdate, Time.smoothDeltaTime, transform.Translate, MoveTowards, Vector3.Lerp, turning on Interpolate of RigidBody, tried even change Time settings and nothing helps even when add a Plane in New Scene and attach this script to Plane.
Before a moment i tried to attach rigidbody2D to Quad and see what will happens and there is still lag when Quad is falling down even without any code. This makes me wondering why this is happening?
I'm out of options. Please help.
sorry to post in this old thread, but did you find any fix for this? This issue is driving me crazy! $$anonymous$$y game has precision controls and the lag makes it look really weird
Answer by Downstream · Feb 15, 2015 at 04:57 PM
I think you're not supposed to increment individual variables of a transform position. C# gives an error if you try to do that. Try increment transform.position with another Vector3.