protected void SwitchToNode(BehaviourTreeNode node) { if (IsInUpdate && CurrentController) { CurrentController.RequestSwitchToNode(this, node); } else { CurrentController.RequestSwitchToNode(null, null); Debug.LogError("Unable to switch state outside of OnUpdate()!", this); } }