Justin,
I'm running into a problem with trying to share External Behavior Trees. They act differently from Trees maintained within the component. If you have your Behavior Tree Component with External Behavior Tree connection on a gameobject within the character hierarchy other than the gameobject that contains the class where you have your properties (to be mapped), you get the following error message for each property you have mapped.
Error: Unable to find component on Behavior for property mapping with variable PlayerObj
UnityEngine.Debug:LogError(Object)
BehaviorDesigner.Runtime.SharedVariable`1:InitializePropertyMapping(BehaviorSource)
BehaviorDesigner.Runtime.JSONDeserializationeserializeSharedVariable(Dictionary`2, IVariableSource, Boolean, List`1)
BehaviorDesigner.Runtime.JSONDeserializationeserializeVariables(IVariableSource, Dictionary`2, List`1)
BehaviorDesigner.Runtime.JSONDeserialization:Load(TaskSerializationData, BehaviorSource)
BehaviorDesigner.Runtime.BehaviorSource:CheckForSerialization(Boolean, BehaviorSource)
BehaviorDesigner.Runtime.Behavior:CheckForSerialization()
BehaviorDesigner.Runtime.BehaviorManager:LoadBehavior(Behavior, GameObject, String, Transform)
BehaviorDesigner.Runtime.BehaviorManager:EnableBehavior(Behavior)
BehaviorDesigner.Runtime.Behavior:EnableBehavior()
BehaviorDesigner.Runtime.Behavior:Start()
This doesn't make sense given that I have the Behavior Tree properties all mapped to the correct class on the correct gameobject within the same character hierarchy. It seems to indicate that it's not a true variable mapping.....that the mapping still relies on the behavior tree component w/ external tree connection and the class containing the property be on the same gameobject. This is not the case if I am Not using an external behavior tree.
I have been trying to keep my Behavior Trees on separate gameobjects within the character hierarchy, separate from all of my controller classes because the Unity editor performance simply cannot handle the Behavior Tree and all of the stuff going on in the Inspector in all of those classes (Animator included) if you have that gameobject selected.
It seems that there should be some way to establish the variable/property mappings through code, perhaps using a C# Event system that exists outside of the behavior tree code. This would also eliminate the need to manually establish the property mappings.
Thanks
Allan
I'm running into a problem with trying to share External Behavior Trees. They act differently from Trees maintained within the component. If you have your Behavior Tree Component with External Behavior Tree connection on a gameobject within the character hierarchy other than the gameobject that contains the class where you have your properties (to be mapped), you get the following error message for each property you have mapped.
Error: Unable to find component on Behavior for property mapping with variable PlayerObj
UnityEngine.Debug:LogError(Object)
BehaviorDesigner.Runtime.SharedVariable`1:InitializePropertyMapping(BehaviorSource)
BehaviorDesigner.Runtime.JSONDeserializationeserializeSharedVariable(Dictionary`2, IVariableSource, Boolean, List`1)
BehaviorDesigner.Runtime.JSONDeserializationeserializeVariables(IVariableSource, Dictionary`2, List`1)
BehaviorDesigner.Runtime.JSONDeserialization:Load(TaskSerializationData, BehaviorSource)
BehaviorDesigner.Runtime.BehaviorSource:CheckForSerialization(Boolean, BehaviorSource)
BehaviorDesigner.Runtime.Behavior:CheckForSerialization()
BehaviorDesigner.Runtime.BehaviorManager:LoadBehavior(Behavior, GameObject, String, Transform)
BehaviorDesigner.Runtime.BehaviorManager:EnableBehavior(Behavior)
BehaviorDesigner.Runtime.Behavior:EnableBehavior()
BehaviorDesigner.Runtime.Behavior:Start()
This doesn't make sense given that I have the Behavior Tree properties all mapped to the correct class on the correct gameobject within the same character hierarchy. It seems to indicate that it's not a true variable mapping.....that the mapping still relies on the behavior tree component w/ external tree connection and the class containing the property be on the same gameobject. This is not the case if I am Not using an external behavior tree.
I have been trying to keep my Behavior Trees on separate gameobjects within the character hierarchy, separate from all of my controller classes because the Unity editor performance simply cannot handle the Behavior Tree and all of the stuff going on in the Inspector in all of those classes (Animator included) if you have that gameobject selected.
It seems that there should be some way to establish the variable/property mappings through code, perhaps using a C# Event system that exists outside of the behavior tree code. This would also eliminate the need to manually establish the property mappings.
Thanks
Allan
Last edited: