[BUG] Behavior Manager is created when there is already one in the scene

cesar_genera

New member
Hi there,

I have a Behavior Manager in the scene configured for the project needs (manual update). Always when I drop a prefab with a behavior tree and then I press play a new behavior manager is created.Because there are two managers in the scene I start getting errors and weird behaviors.

This is the error when two behaviors are in the scene
KeyNotFoundException: The given key was not present in the dictionary.
System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) (at <ad04dee02e7e4a85a1299c7ee81c79f6>:0)
BehaviorDesigner.Runtime.BehaviorManager.Tick (BehaviorDesigner.Runtime.Behavior behavior) (at <8273d6b105784beab3b1f76a8d030c0c>:0)

If I save the scene, open a new one, and then get back to the original scene sometimes it starts working. If not, I restart unity and it works 100% of the time. I'm using Unity 2019.2.2f1

Thanks in advance
 
Does your prefab contain a Behavior Manager component? I just tried to reproduce a similar setup but it worked correctly. Did you change the script execution order?
 
Hi,

I haven't modify the sprit execution order for any class of Behavior Designer, but you have pointed me to the correct direction. I just fixed it adding the BehaviorDesigner.Runtime.BehaviorManager just before the "Default time"

Many thanks
 
Top