Search Unity

Question PlayerPrefab gets random NetworkOwnership - Unity Netcode

Discussion in 'Netcode for GameObjects' started by itisMarcii_, Apr 26, 2022.

  1. itisMarcii_

    itisMarcii_

    Joined:
    Apr 5, 2022
    Posts:
    111
    Hallo,

    I am trying to spawn multiple Clients at once and simultaneously spawn a Character(NetworkObject attached) with ClientID(NetworkObjectID) ownership on the server.

    If I spawn multiple Clients at once they often get a "random" OwnershipID from a different NetworkObject than themselves. If I spawn them in an 1sec interval, the spawned CharacterNetworkObjects interfere with the ClientOwnership and a CharacterNetworkObject can be the Owner of an Client without calling a script method.

    Since I try to simulate an MMO setting (Several player can join at the same time), a lobby or other approaches are not possible.

    I am using Unity version 2021.2.18f1 and the newest Unity Netcode version 1.0.0-pre.7
    Also, the Client and Server are on two different Projects. The connection is via Unity Transport and an IPv4 connection.