- Home /
Question by
DHag · Jun 10, 2014 at 04:40 PM ·
animationrigidbody2dsmoothjitter
How to stop jitter with rigidbody2D
Hi, I have created a minimal 2D Program where I add Force to a Sprite with a rigidbody2D and a Collider2D. The Sprite is correctly animated according to 2D Physics but its not animating smoothly. It looks like the Sprite is jumping slightly back and forth. Deactivating VSync reduces the jittering but still not smooth. Setting the velocity directly results in the same outcome. The Force is applied on Mouse Down. The Script is placed on the Sprite. This can't be intentional right? Or am I already doing something wrong?
public class BallBehaviour : MonoBehaviour {
void OnMouseDown () {
rigidbody2D.AddForce(new Vector2(150f,0f));
}
}
Comment
Answer by mikhail111777 · Jul 06, 2014 at 12:02 AM
Try setting interpolation to Interpolate.
That's what I thought too, but I already tried that and there was no change.