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


    Jun 9, 2016
    Hi there,

    When I add a new entry to a
    , I get the following error:

    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


    Mar 22, 2021
    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.
    Attempting to access it on the client.

    Throws the following error message.

    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.

    Any insight into this?