Search code examples
unity-game-enginemultiplayerunity3d-unet

Making Unique Playername for my multiplayer game using unet Unity 3d


im having difficulties in creating unique player name system for my multiplayer game. i've tried using [Command] to get playername variable[SyncVar] and send data to server then send data from server to client using [ClientRpc] but i've got no luck. hope someone can help me. Thanks!


Solution

  • You can get uniqueId from NetID.

    NetworkInstanceId gamePlayeruniqueNetID = gamePlayer.GetComponent<NetworkIdentity>().netId;