Like the title says I always get the KeyNotFound error.
The strange thing is that I use the code in the same script, but different void to control other characters and it works fine. The error script:
Node[] outgoingNodes = currentLocation.nodes;
List<SCPnodeData> validNodes = new List<SCPnodeData>();
for (int i = 0; i < outgoingNodes.Length; i++)
{
SCPnodeData temp = nodeName2Data[outgoingNodes[i].name];
if (temp.weight == true)
{
validNodes.Add(temp);
}
}
This code should define the next move of the character and the script should add nodes where the character can go to (called validNodes).
The error message tells me that the error appears on line 7.
How can I now try to solve this problem. Like whats the best approach for my problem?