Search Unity

Ghost Authoring Component: Getting ArgumentException when generating code

Discussion in 'Entity Component System' started by stefan-falk, Jan 7, 2020.

  1. stefan-falk

    stefan-falk

    Joined:
    Nov 24, 2019
    Posts:
    15
    I am following the "Getting Started" guide on https://docs.unity3d.com/Packages/com.unity.netcode@0.0/manual/getting-started.html

    So far, everything worked but the part where I am supposed to generated the code for the cube/unit, I am getting the following error:

    Code (CSharp):
    1. ArgumentException: An item with the same key has already been added. Key: UnityEditor.Experimental.TerrainAPI.PaintHeightTool
    2. System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) (at <437ba245d8404784b9fbab9b439ac908>:0)
    3. System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) (at <437ba245d8404784b9fbab9b439ac908>:0)
    4. Unity.NetCode.Editor.GhostAuthoringComponentEditor.GenerateGhost (Unity.NetCode.GhostAuthoringComponent ghostInfo) (at Library/PackageCache/com.unity.netcode@0.0.4-preview.0/Editor/GhostAuthoringComponentEditor.cs:443)
    5. Unity.NetCode.Editor.GhostAuthoringComponentEditor.OnInspectorGUI () (at Library/PackageCache/com.unity.netcode@0.0.4-preview.0/Editor/GhostAuthoringComponentEditor.cs:272)
    6. UnityEditor.UIElements.InspectorElement+<>c__DisplayClass55_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <cdd38c6cb7c446c6ac90945c7521da61>:0)
    7. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

    Since there was a hint to TerrainAPI, I tried to just uninstall the "Terrain Tools" from the package manager. However, that didn't help.

    Is there a way I can find out where this error comes from?
     
  2. stefan-falk

    stefan-falk

    Joined:
    Nov 24, 2019
    Posts:
    15
    Okay, after restarting Unity it worked. No idea where this came from but well. It works now.
     
  3. florianhanke

    florianhanke

    Joined:
    Jun 8, 2018
    Posts:
    426
    I had the same issue and solved it the same as you - but it’s not the best solution, as I quite like to use the terrain tools ;)