I'm getting some vibration-like jitter in my character when I run around, not always noticeable, but it goes away if I turn off Interpolation in the Rigidbody, which is backwards (everyone says turning it ON smooths things). Unity says that Rigidbody.MoveRotation() is only good for kinematic Rigidbody, that it will cause jitter with non-kinematic, and that you should directly update Rigidbody.angularVelocity instead (https://discussions.unity.com/t/rigidbody-cinemachine-jitters-with-without-interpolate). This is with pathfinding click-to-move, which does constantly call MoveRotation() even when running in an almost straight line, so I can't minimize the problem by skipping the MoveRotation() call when running almost straight.
Anyway, nothing I'm doing to replace MoveRotation() is working. I've tried several AddTorque() and Rigidbody.angularVelocity things, and they all do exactly the same thing: the player never turns at all, just runs in the direction he's already pointing at the outset. I'm about to give up trying to do anything about it, but I was wondering if anyone has tried this, and if there is a known reason that AddTorque() and angularVelocity won't turn the player.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Unless you're modifiying AC's codebase, then AC will be in control of the character's rotation each frame - additional calls to set it will need to be in LateUpdate for them to take effect.
What are your AC/Unity versions, and can you share shots of your Player's full Inspector? You can try unchecking Move with Rigidbody?, or replace the Rigidbody + Capsule Collider with a Character Controller, unless you have a specific need to use one.
Thanks for the quick reply, as always! I was trying to slightly modify DoTurn() in Char.cs to resolve the issue mentioned in the Unity forum post, and as nothing I'm doing has any result other than the player running straight instead of turning (AddTorque() and modifying rigidbody.angularVelocity both cause this when replacing MoveRotation()), my question was to see if you had insight into what happens in Char.cs that I might be missing. However, the jitter is much less since resolving a Cinemachine issue, so I'm going to stop fooling with it. Also, I hadn't considered that I could add a character controller (duh). So, either way, ignore this for now, and thanks again.