2.1.4 Issues

Hello, I have this abstract base task.
The task is placed inside a subtree.
Unity_0FrBKerWK6.png
public abstract class AAgentCondition : Conditional
{
public AIController agentController;


public override void OnAwake()
{
base.OnAwake();

if (m_BehaviorTree == null)
Debug.LogError($"Behavior Tree is null! on {GetType().Name}", gameObject);

Debugger.LogAssertNotNull(m_BehaviorTree, gameObject);

SharedVariable<AIController> controllerVariable = m_BehaviorTree.GetVariable<AIController>(nameof(agentController), SharedVariable.SharingScope.GameObject);

Debugger.LogAssertNotNull(controllerVariable.Value, gameObject);
agentController = controllerVariable.Value;
}
}

The agent controller is null after.

my blackboard:
1759830789717.png
 
This looks related to this:

 
my code:
[Opsive.Shared.Utility.Category("OCZ")]
public abstract class AAgentCondition : Conditional
{
public AIController agentController;


public override void OnAwake()
{
base.OnAwake();

if (m_BehaviorTree == null)
Debug.LogError($"Behavior Tree is null! on {GetType().Name}", gameObject);

Debugger.LogAssertNotNull(m_BehaviorTree, gameObject);

SharedVariable<AIController> controllerVariable = m_BehaviorTree.GetVariable<AIController>(nameof(agentController), SharedVariable.SharingScope.GameObject);

Debugger.LogAssertNotNull(controllerVariable.Value, gameObject);
agentController = controllerVariable.Value;
}
}

public sealed class AIStateCondition : AAgentCondition
{
public SharedVariable<AIState> stateVariable;


public override TaskStatus OnUpdate() => agentController.ActiveState == stateVariable.Value ? TaskStatus.Success : TaskStatus.Failure;


#if UNITY_EDITOR
public override string ToString()
=> $"AI State: {(stateVariable == null ? "null" : stateVariable.Value)}";
#endif
}

the tree (subtree reference):
1759836024684.png

1759835939100.png
1759835971019.png
 
These exceptions all look related to subtrees. There were many subtree related fixes in 2.1.4 so please try that version.
 
Tested with 2.1.4.
Still happening.

Somehow I got this:
Both Graph and GameObject variables were overridden by the variables from a referenced subtree when I entered play time
1759836975740.png1759836966560.png

Design time:
Graph variables are empty.
1759837064148.png
 
Back
Top