Movement stutter with rigidbody
I am trying to switch my character over from using a character controller to using a rigidbody so I can create my own colliders instead of using the capsule collider the character controller forces you to use. I decided to try doing movement using rigidbody.MovePosition(), however the movement seems to be pretty jittery and keeps stuttering. I have all my inputs and calculations being handled in Update() and my FixedUpdate() is just one line:
private void FixedUpdate()
{
rb.MovePosition(transform.position + (movement * runSpeed * Time.deltaTime));
}
So far I have tried to change the rigidbody so that Interpolate is set to Interpolate, and I have also tried messing around with the fixed timestep in the project settings, but nothing seems to make it completely smooth. Is there another solution that I can try? If not, what other options for movement should I try?
I'm having the same issue. Everything runs fine if I call rb.$$anonymous$$ovePosition(pos) in Update though which is weird... $$anonymous$$y understanding is .$$anonymous$$ovePosition should smoothly move a non-kinematic Rigidbody with interpolation, and that that logic should reside in FixedUpdate to avoid common issues like this. I'm clearly doing something wrong.
So I think the issue is transform.position. I know this post is old but if you or anyone else sees this try using rb.position instead. Also, I just noticed you're using deltaTime (which shouldn't actually matter because iirc Unity will return fixedDelataTime in FixedUpdate anyway but) you might want to try fixedDeltaTime just in case.