Question by
$$anonymous$$ · Feb 12, 2018 at 12:18 PM ·
physicsrigidbodymotion
Smooth motion rigidbody
Why does this code make my rigidbody stutter and not move smoothely?
private void FixedUpdate(){
//rigidbody.velocity = new Vector2(3.0f, rigidbody.velocity.y); (also stuttering)
rigidbody.MovePosition(transform.position + Vector3.right * 3.0f * Time.fixedDeltaTime);
}
Comment
Try enabling Rigidbody Interpolate option. Stuttering may be caused by FixedUpdate() running slower then the Update(). Therefore you could also try to decrease fixed timestep. Here's a link that could help you.
Answer by GamerGurkeLP · Feb 12, 2018 at 12:49 PM
Maybe it doesnt rely on your Code, in my Case the Friction between the Ground and the Player caused him to stutter. Try turning that off with a Physics-Material on the Player.