Hi everyone,
I've done a bunch of searching for an answer, and can't seem to find anything that has helped. In a nutshell, my character's movement is jagged/jittery and I'm trying to smooth it out. However, there is a slight wrinkle compared to other answers I've researched: the character is currently being moved in 2 ways: 1) with a transform.Translate using a speed variable in the local z direction, and 2) when the user presses a button, I am calling rigidbody.AddForce in the y direction (resulting in a jump). Both of these forms of movement are occurring in the Update function in my character controller script. The character is a prefab, instantiated at run-time. The character moves smoothly in the z direction, but when it jumps or falls in the y direction the movement appears jagged and not smooth (sort of like a sawtooth, up/forward/up/forward/up/forward really fast... appears to be each frame from my guess).
At first, I thought the issue was my camera follow script, which uses a Vector3.Lerp to follow the character. However, when I disable the camera follow script so the camera doesn't move, the character's movement still appears jittery/jagged when moving up or down (same as when the camera follow script is enabled).
Any ideas how to fix? I was thinking of using a Lerp to move the character, but unsure how to determine what my target position would be. Maybe there's a better way. I've also tried using interpolate/extrapolate on the character's rigidbody, but this did not change anything.
-pete
↧