I’m encountering an issue where my character in Unity experiences unexpected jitter in the Y-axis while moving. This jitter is unwanted and disrupts the smoothness of the character’s movement. I’m utilizing a Rigidbody component for character movement. How can I resolve this Y-axis jitter and ensure consistent and smooth character movement
but notice that, when is use only one plane for the ground, everything works fine. but with some ground i have this problem.
i provide an example that you can download it.
my code :
public class PlayerMovement : MonoBehaviour
{
public float moveSpeed = 6f; // The speed at which the player moves
private Rigidbody rb;
private float horizontalInput;
private void Start()
{
rb = GetComponent<Rigidbody>();
}
private void Update()
{
horizontalInput = Input.GetAxis("Horizontal");
}
private void FixedUpdate()
{
// Calculate the movement force
Vector3 movementForce = new Vector3(horizontalInput * moveSpeed * 2f, 0f, 0f);
// Apply the movement force to the player's Rigidbody
rb.AddForce(movementForce, ForceMode.Force);
}
}
my rigidbody settings :
Mass : 1
Drag : 0
Angular Drag : 0.05
Garvity : Checked
Is Kinematic : Unchecked
interpolate : interpolate
Colision Detection : Continuous
Freeze Position : All Unchecked
Freeze Rootation : All Checked
9830058–1413690–Movement.unitypackage (29.3 KB)