Error: Condition.Check when enabled = false

Forums 💬 NodeCanvas ⚙️ Support Error: Condition.Check when enabled = false

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #16237
    nodeshelp
    Participant

      Getting this error after upgrading to NodeCanvas 3.0.8:

       

      Condition.Check when enabled = false
      UnityEngine.Debug:Assert(Boolean, String)
      NodeCanvas.Framework.ConditionTask:Check(Component, IBlackboard) (at Assets/ParadoxNotion/CanvasCore/Framework/Runtime/Tasks/ConditionTask.cs:75)
      NodeCanvas.Framework.ConditionTask:CheckCondition(Component, IBlackboard) (at Assets/ParadoxNotion/CanvasCore/Framework/Runtime/Tasks/ConditionTask.cs:62)
      NodeCanvas.StateMachines.Branch:OnEnter() (at Assets/_Scripts/for NodeCanvas/Branch.cs:39)
      NodeCanvas.StateMachines.FSMState:OnExecute(Component, IBlackboard) (at Assets/ParadoxNotion/NodeCanvas/Modules/StateMachines/FSMState.cs:88)
      NodeCanvas.Framework.Node:Execute(Component, IBlackboard) (at Assets/ParadoxNotion/CanvasCore/Framework/Runtime/Graphs/Node.cs:293)
      NodeCanvas.StateMachines.FSM:EnterState(FSMState, TransitionCallMode) (at Assets/ParadoxNotion/NodeCanvas/Modules/StateMachines/FSM.cs:164)
      NodeCanvas.StateMachines.FSMState:CheckTransitions() (at Assets/ParadoxNotion/NodeCanvas/Modules/StateMachines/FSMState.cs:120)
      NodeCanvas.StateMachines.FSMState:Update() (at Assets/ParadoxNotion/NodeCanvas/Modules/StateMachines/FSMState.cs:99)
      NodeCanvas.StateMachines.FSM:OnGraphUpdate() (at Assets/ParadoxNotion/NodeCanvas/Modules/StateMachines/FSM.cs:87)
      NodeCanvas.Framework.Graph:UpdateGraph(Single) (at Assets/ParadoxNotion/CanvasCore/Framework/Runtime/Graphs/Graph.cs:684)
      NodeCanvas.Framework.Graph:UpdateGraph() (at Assets/ParadoxNotion/CanvasCore/Framework/Runtime/Graphs/Graph.cs:677)
      ParadoxNotion.Services.MonoManager:Update() (at Assets/ParadoxNotion/CanvasCore/Common/Runtime/Services/MonoManager.cs:98)

      #16241
      Gavalakis
      Keymaster

        Hello,

        In v3.+ conditions need to be Enabled and Disabled from the node that uses them. I see you are using a custom node named “Branch”. Can you please post your node code here and I will let me know the changes that need to be made so that the node works correctly. 🙂

        Thanks!

        #16240
        nodeshelp
        Participant

          Thank you for the quick response! This is actually a node that you kindly provided in response to my question awhile ago. Here is the code:

          using System.Collections;
          using System.Collections.Generic;
          using UnityEngine;
          using NodeCanvas.Framework;

          namespace NodeCanvas.StateMachines
          {

          public class Branch : FSMState, ITaskAssignable<ConditionTask>
          {

          [SerializeField]
          private ConditionTask _condition;

          private ConditionTask condition
          {
          get { return _condition; }
          set { _condition = value; }
          }

          Task ITaskAssignable.task
          {
          get { return condition; }
          set { condition = (ConditionTask)value; }
          }

          public override bool allowAsPrime { get { return false; } }
          public override int maxInConnections { get { return -1; } }
          public override int maxOutConnections { get { return 2; } }

          protected override void OnEnter()
          {
          if (condition == null)
          {
          Finish(false);
          return;
          }

          var i = condition.CheckCondition(graphAgent, graphBlackboard) ? 0 : 1;
          (outConnections[i] as FSMConnection).PerformTransition();
          Finish(i == 0);
          }

          ////////////////////////////////////////
          ///////////GUI AND EDITOR STUFF/////////
          ////////////////////////////////////////
          #if UNITY_EDITOR

          public override string GetConnectionInfo(int i)
          {
          return i == 0 ? “TRUE” : “FALSE”;
          }

          #endif

          }

          }

           

          #16239
          Gavalakis
          Keymaster

            Hello again,

            Ah, I see 🙂

            I have attached for you here the modified version of “Branch” that should now work with the new version of NodeCanvas.

            Let me know if that works for you as expected and without any issues.

            Thanks!

            #16238
            nodeshelp
            Participant

              Seems to work great. No issues. Thank you so much!!!

            Viewing 5 posts - 1 through 5 (of 5 total)
            • You must be logged in to reply to this topic.