Search Unity

Question Dictionary of all players

Discussion in 'Netcode for GameObjects' started by Gogunio, Jan 19, 2023.

  1. Gogunio

    Gogunio

    Joined:
    Mar 14, 2022
    Posts:
    10
    Hi everyone
    Does someone know how to create a dictionary that will store all players?
    I have a script for every player that stores the name
    But how i can fill the dictionary with all the names?

    Thanks
     
  2. Gogunio

    Gogunio

    Joined:
    Mar 14, 2022
    Posts:
    10
    Also i would like to know how to print the dictionary

    Cheers
     
  3. RikuTheFuffs-U

    RikuTheFuffs-U

    Unity Technologies

    Joined:
    Feb 20, 2020
    Posts:
    440
    Hi @Gogunio , you can do it in the OnNetworkSpawn of each player (doc here)