Search Unity

Third Party Mirror Networking - Transform and Animations are jittery for server controlled AI

Discussion in 'Multiplayer' started by Serinx, Feb 11, 2022.

  1. Serinx

    Serinx

    Joined:
    Mar 31, 2014
    Posts:
    788
    I'm using Mirror Networking. I spawn a bear and it's got the standard NetworkTransform and NetworkAnimator with interpolation enabled.

    The bear is controlled by the host. It looks perfect on the host but jittery/laggy on the clients.

    The players themselves are a lot smoother.

    For some reason it looks extremely jittery even when running in a straight line.
    Any ideas what this could be? Attaching a video for reference:


    Appreciate any help.

    Edit: Pretty sure it's the animator and not the transform. I disabled the animator and it slid around smoothly like a bear on ice.

    Edit2: Seems to be a conflict between root motion animations and the position lerp
     
    Last edited: Feb 11, 2022
  2. Serinx

    Serinx

    Joined:
    Mar 31, 2014
    Posts:
    788
    Reading up on it - I only found a few relevant posts but supposedly syncing root motion animations and position simultaneously is a nightmare.
    Guess I'll change to non-root motions and move the bear via code.
     
    Slaghton likes this.
  3. sofabivaadin

    sofabivaadin

    Joined:
    Apr 7, 2022
    Posts:
    6
    Did you found something ? I have the same problem with a platform moving.

    When the host look at the platform moving everything is clear because the movement is server side.

    But when the client look the platform AND move the platform jitter.

    The platform and the player move with fixedUpdate()