Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question Save different data than string for player

Discussion in 'Netcode for GameObjects' started by miccalisto, Apr 8, 2023.

  1. miccalisto

    miccalisto

    Joined:
    Feb 20, 2018
    Posts:
    40
    Netcode has this Player class that has a data dictionary in which one can store values to save for the player, but it only accept strings and I want to save a different data for example the Color of the player. Can I modify the Player class by adding custom properties to it or it will not work if I try to do that? Or how else can I save data than other string per player?
     
  2. lavagoatGG

    lavagoatGG

    Joined:
    Apr 16, 2022
    Posts:
    229
    I think the lobby service is the one that allows for string data. Maybe you can use network list to save data about players (each index stores data for the player with that id)