Search Unity

Bug NetworkDictionary not working?

Discussion in 'Netcode for GameObjects' started by daniel_lochner, Jun 29, 2021.

  1. daniel_lochner

    daniel_lochner

    Joined:
    Jun 9, 2016
    Posts:
    111
    Hi there,

    When I add a new entry to a
    NetworkDictionary
    , I get the following error:
    443FB34A-E71D-46C0-9084-8504344ADB7E.png

    If you only have 1 player connected however, then the dictionary works as a regular dictionary without any errors.

    Thanks for your time.
     
  2. muebele

    muebele

    Joined:
    Mar 22, 2021
    Posts:
    2
    The NetworkDictionary is also not working for me. It functions normally in single player, and the other NetworkVariables are syncing fine in multiplayer, but when the Client attempts to read a value from a NetworkDictionary, it throws an error, although mine is different than yours Daniel:

    Populating it on the server.
    Capture1.PNG
    Attempting to access it on the client.
    Capture2.PNG

    Throws the following error message.
    capture3.PNG


    Looking into the NetworkDictionary right before it attempts to read, this is what it looks like. I notice that I can see the information I want contained in the "m_DirtyEvents" field but "m_Dictionary" is still empty. "m_NetworkBehaviour" is also null, I don't know if that matters or not.
    capture4.PNG

    Any insight into this?
     
unityunity