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.

Why is my multiplayer client teleporting to host location and having host object going missing.

Discussion in 'Multiplayer' started by Icepanda250, May 5, 2023.

  1. Icepanda250


    May 1, 2023
    When I start the client it teleports to the hosts location. After the client teleports to the host when it moves around the host is not there. Same goes for the host were it can move around but the client isn't there.
  2. KikiSaintonge


    Unity Technologies

    Mar 24, 2022
    Not sure what kind of netcode stack you are using to build this experience, but this sounds like a common issue devs run into when they don't synchronize their data/input/state correctly from host to client and back.

    What is likely happening is when you move/send your input on either client or host, both client and host are receiving the same input and resolving to the same position, thus giving it the illusion as if the client/host "aren't there" once you move around.

    You'll need to look into separating the client and host input and movement. Typically this is down through an "isOwner" check in the input update loop, but that can depend on what netcode you're using.

    I would recommend looking into the documentation of the netcode you are using and following it carefully to ensure you're not missing a synchronization step - particularly when it comes to input. Look at how to separate input/position with the solution you've chosen.