Search Unity

Bug Jitter while moving after version update

Discussion in 'Editor & General Support' started by Stanecek, Nov 10, 2022.

  1. Stanecek

    Stanecek

    Joined:
    Apr 5, 2018
    Posts:
    1
    I have a project with a basic character controller and a basic scene to move around in. I upgraded from version 2018.4.28 to version 2022.1.21 and now my character jitters around while moving. My character uses transform.position to move around and is moved in the Fixed Update function. Is there something that has changed between these two versions that would cause this jitter?
     
  2. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    7,859
    Well there's a bit of a flaw in this regardless of Unity version. FixedUpdate is in time with the physics system, and should be used to manipulate rigidbodies with the supplied methods such as
    Ridigbody.AddForce()
    or
    Rigidbody.MovePosition()
    .

    Considering FixedUpdate happens at a lower interval to Update, I would expect the movement to be jittery regardless of Unity version.

    If this object has a rigidbody, you should manipulate it as suggested, and set the rigidbodies interpolation to Interpolate: https://docs.unity3d.com/Manual/class-Rigidbody.html

    If it doesn't/if physics isn't a factor, you should update it's position in
    Update()
    instead.