Issue resuming BT when 'PauseWhenDisabled" is set to true

slipyfrog

New member
Hello Justin, I hope this message finds you well. Please see below for a description of a possible issue with the intended functionality of trees when activating/deactivate their gameobject.

Any advice or insight? Thanks in advance!

Wes





Behavior Tree starts by it self when resuming even though StartWhenEnable is set to false and the Tree is clearly not running.

Steps:
1. In an empty Scene, create two gameobjects BT_A and BT_B. Add A behavior tree to both BT_A and BT_B.
2. Set PauseWhenDisable=true via the Unity Inspector for BT_A and BT_B
3. Set StartWhenEnabled=false for BT_B
5. Add Idle node to BT_A and BT_B
7. Press play to run the simulation
8. Select BT_B from the Unity Editor Hierarchy and disable the GameObject via the unity inspector by checking the active/deactive check box.
9. Reenable the BT_B Gameobject by checking the checkbox to active in the active/deactivate check box of the inspector.

Observed:
Notice that BT_B has now run even though the behavior tree was not started prior to the deactivate of the MyTestNPC gameobject.

The issue only seems to manifest when there are more that one Behavior Trees in the scene. Delete BT_A and re-run the project. In this case you will see that the BT_B is not run when the gameobject is re-activated.


Expected:
The Behavior Tree should not be Started when it's gameobject becomes activated following a deactivation where Behavior Tree was not yet started.


I've attached a video to illustrate the issue here (sorry for the poor audio quality). if the repo steps are not clear, please let me know and i will re-record a video:

 
Are you running the latest version? When I tried those repro steps the B behavior tree did not start after enabling the GameObject.
 
Sorry for the late reply, it's pretty busy for me and this was not a blocking issue.

I re-ran the reproduction steps on my MacBook and observer the same results. In both tests, the Behavior Tree B would automatically start when its game object was resumed.

You can see this at the end o the attached video. B was not started when it's game object was deactivated. But B is started after re-activating its game object.



The project is a clean project, running in Unity 2021.2.16
Tested on both Win10 and macOS 12.2
Behaviour Designer version is 1.7.2 (which was just downloaded via the package manager prior to running the reproduction steps.

I was going to download an older version of Behavior Designer to see if it is a regression issue/ to see If I was just miss reading something but it looks to be broken.

In any case, its not super urgent but I wanted to log it just in case.

If you do end up reproducing it, please let me know so I know I'm not losing my mind :)
 
Top