Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

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:
    146
    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?