StackedConditional shared variables values don't get set

WhiteMonkey

New member
I have a weird issues with StackedConditional task. I use the StackedConditional task to basically check if AI see or hear something. The conditional check happen correctly but in the two conditional tasks I stacked, I also set some SharedVariables before to return success. Unfortunately, some variables don't get set when the game is running. The conditional happens as expected, the line of codes that set the SharedVariables get call correctly but the value of the SharedVariable doesn't change.

But if I run the game and reassign the shared variables to the conditional tasks, then everything work fine until I stop play mode.
 
I managed to reproduce the issue. The problem occurs when using the Behavior Tree Reference Task with a StackedConditional task inside the External Behavior Tree that is referenced. When doing so, all Shared variables values set inside the conditional tasks of the Stacked conditional will not be updated in the Variables tab.
 
Can you list the steps? I just tried and wasn't able to reproduce the issue.
 
1. Create an external behavior tree with the following tasks
ExternalBehaviorTree.PNG

2. Create a simple conditional task that assign a SharedVariable on success.
ConditionalTest.PNG

3. Create a simple behavior tree with a behavior tree reference to the external behavior tree.
. EditorSetUp.PNG

I am using Unity 2020.3.15f2 and version 1.17 of Behavior Designer.
 
I noticed that the issue only happen when the external behavior tree and the one instancing it have declared the same SharedVariable. If the SharedVariable is only declared inside the External behavior tree, it works fine.
 
Top