Hello, I’m trying to add my own character to the Unity Character Customization demo but I keep getting this error:
KeyNotFoundException: The given key was not present in the dictionary.
System.Collections.Generic.Dictionary2[System.String,System.Collections.Generic.List
1[CharacterElement]].get_Item (System.String key)
CharacterGenerator.PrepareConfig (System.String config) (at Assets/Plugins/CharacterGenerator.cs:113)
CharacterGenerator.CreateWithConfig (System.String config) (at Assets/Plugins/CharacterGenerator.cs:79)
Main+c__Iterator0.MoveNext () (at Assets/DressingroomExample/Main.cs:28)
My character follows all the same naming conventions as the demo’s character. I can’t seem to figure out what’s wrong.
It points to this line in the code:
foreach (CharacterElement e in sortedElements[currentCharacter][categoryName])
{
if (e.name != elementName) continue;
element = e;
break;
}