- Home /
2D sprite movement stuttering
When my character move (x and y axis) the character stutters for a bit. I'm directly setting the velocity of the "rigidbody2D" (not using e.g. AddForce()). Is this normal? Or is there something wrong with this technique.
BTW the FPS for my game is currently around 80 fps.
Answer by senc01a · Sep 16, 2014 at 10:36 AM
Initially there is nothing technically incorrect about setting the velocity directly, as opposed to adding forces. Obviously by setting the velocity you will have instant acceleration, and when adding force a more naturally accelerated movement. I've used your approach on several occasions and never did I experience any stuttering. My first guess is that this is related to something else. Are there any other things that you might be doing which may cause it?
I don't think so. I sorta followed the tutorial from here
Answer by HarshadK · Sep 16, 2014 at 11:13 AM
It might be the case of screen tearing caused due to vertical sync. Since your game runs at a frame rate of 80 which is greater than your refresh rate (60, I guess) it might be causing this screen tearing resulting in choppiness for your character.
One solution is to cap your FPS to 60 or equal to the refresh rate of your monitor (usually people have it set to 60, so 60 is safe bet).
not $$anonymous$$ring, its uneven movement for the sprite that's moving
Like when latency is high for $$anonymous$$$$anonymous$$O game ($$anonymous$$us the teleport backwards part)
Did you try moving your character using AddForce()? since setting velocity directly (if done frequently) can cause unstable physics behavior resulting in stutter.
Answer by TruffelsAndOranges · Jul 11, 2015 at 09:12 PM
I have the same stuttering in the latest Unity 5 version. I'm using interpolation and only moving objects by changing the rigidbody2d velocity.
Your answer
![](https://koobas.hobune.stream/wayback/20220613163119im_/https://answers.unity.com/themes/thub/images/avi.jpg)