dangoyette
New member
My first Behavior Tree was added directly to the game object, and I was disappointed that editing the Behavior Tree in Play Mode didn't keep the changes when I left Play Mode. I figured this was because the entire tree was being serialized onto the game object, and game object changes aren't preserved after leaving Play Mode. So, I exported the Behavior Tree as an external behavior, and assigned that to the object.
However, even though the behavior tree is now an asset, I'm finding two things:
However, even though the behavior tree is now an asset, I'm finding two things:
- Changes to the Extrernal Behavior Tree during Play Mode don't actually affect the game objects using that behavior tree. For example, one of the public properties of an Action determines its color. If I change that color on the Action node during Play Mode, the game objects still use the old color. It's as if each game object makes a copy of the External Behavior Tree on Start, and they don't observe changes to the tree that might occur later.
- In addition, the changes to the External Behavior Tree get reverted upon leaving Play Mode, meaning that External Behavior Trees don't see to be a better approach to preserving Play Mode changes. This is surprising to me, as I though Unity didn't revert changes to assets when leaving play mode.