Hi,
I have a problem when I try to tick behavior tree manually.
BehaviorManager.instance.Tick(_allEnemies[index]);
The error that I have is
KeyNotFoundException: The given key was not present in the dictionary.
System.Collections.Generic.Dictionary`2[BehaviorDesigner.Runtime.Behavior,BehaviorDesigner.Runtime.BehaviorManager+BehaviorTree].get_Item (BehaviorDesigner.Runtime.Behavior key) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:150)
BehaviorDesigner.Runtime.BehaviorManager.Tick (BehaviorDesigner.Runtime.Behavior
When I debug my code I can see that BehaviorManager.instance have only one BehaviourTree but I don't know why. Does anybody know how BehaviorManager.instance is collecting BehaviourTries and what could I do wrong to get this error.
I have two agents on this scene and for both of them I load and instantiate behaviours manually
ExternalBehavior tmpExternalTree = Object.Instantiate(externalBehavior);
tmpExternalTree.Init();
UnusedBehaviours.Push(tmpExternalTree);
I have a problem when I try to tick behavior tree manually.
BehaviorManager.instance.Tick(_allEnemies[index]);
The error that I have is
KeyNotFoundException: The given key was not present in the dictionary.
System.Collections.Generic.Dictionary`2[BehaviorDesigner.Runtime.Behavior,BehaviorDesigner.Runtime.BehaviorManager+BehaviorTree].get_Item (BehaviorDesigner.Runtime.Behavior key) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:150)
BehaviorDesigner.Runtime.BehaviorManager.Tick (BehaviorDesigner.Runtime.Behavior
When I debug my code I can see that BehaviorManager.instance have only one BehaviourTree but I don't know why. Does anybody know how BehaviorManager.instance is collecting BehaviourTries and what could I do wrong to get this error.
I have two agents on this scene and for both of them I load and instantiate behaviours manually
ExternalBehavior tmpExternalTree = Object.Instantiate(externalBehavior);
tmpExternalTree.Init();
UnusedBehaviours.Push(tmpExternalTree);