Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Resolved NetworkTransform Interpolation and position offset at clients

Discussion in 'Multiplayer' started by Deleted User, Jul 12, 2023.

  1. Deleted User

    Deleted User

    Guest

    I have some trouble with character position synchronization in multiplayer project. I am using ClientNetworkTransform, because I need clients to be able to manage position of their owned characters (don't need full server authoritative solution). Characters are spawned in air and fall to ground. But after landing on ground, characters on not owned clients has different Y axis position (floating above ground) - see screenshots:

    - Client A is owner of black character and see its correct Y position. But see yelow character floating above ground.
    upload_2023-7-12_11-31-37.png

    - Client B is owner of yelow character and see opposite.
    upload_2023-7-12_11-31-46.png

    It has something to do with Interpolation. When I turn off Interpolation during Play mode, it will fix character position at all clients. Then I just turn interpolation on again... I need interpolation for smooth movement. So should I turn interpolation off and on from time to time as workaround?

    What doesn't work (has no effect):
    - Disabling and enabling ClientNetworkTransform component
    - Disabling and enabling position syncing durig Play mode
     
    firebird721 likes this.
  2. fernando-a-cortez

    fernando-a-cortez

    Unity Technologies

    Joined:
    Dec 14, 2020
    Posts:
    9
    Hi,

    May I ask what version of Netcode for GameObjects, and what version of Multiplayer Samples Utilities you're using for your project?

    I wasn't able to reproduce this issue on the latest version of our ClientDriven sample, which utilizes both Netcode for GameObjects v1.4.0 and Multiplayer Samples Utilities v1.6.1. The PlayerPrefab for this project has a ClientNetworkTransform component with Interpolation enabled, and can jump and fall back to the ground. I even bumped up the y-position of the spawn points so they'd fall a considerable distance as well, and couldn't spot the same issue. I'd recommend taking a look at that sample first and see if there's a way to reproduce your issue. I hope that helps!
     
  3. Deleted User

    Deleted User

    Guest

    CodeNinja- likes this.