Behaviour Pause Logic fails depending on Invocation Order

Forums 💬 NodeCanvas ⚙️ Support Behaviour Pause Logic fails depending on Invocation Order

  • This topic has 1 reply, 2 voices, and was last updated 1 month ago by Gavalakis.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #23151
    Janniqz
    Participant

      Hello!

      I’ve recently been running into an issue where if one BehaviourTree causes another BehaviourTree to Pause, the second BehaviourTree would immediately resume itself.

      From what I can tell this seems to be related to the invocation order of the MonoManager onUpdate Action.
      If the pausing BehaviourTree is first in the invocation list, the second one will be unsubscribed but will still call UpdateGraph() once because they were still on the invocation list when the event was initially invoked.
      If it’s the other way around everything works as expected as the now paused BehaviourTree already went through their UpdateGraph() before being paused.

      The solution that I’ve come up with for this is adding a justPaused field to the Graph class that is checked in UpdateGraph(). If true, unset it and do nothing.
      StartGraph(), Stop(), and Resume() would set the value to false, with only Pause() setting it to true.

      Hope this helps!

      #23159
      Gavalakis
      Keymaster

        Hello!

        Thank you for letting me know as well as sharing your fix. I will look into it and maybe add your fix as well.

        Thanks again 🙂

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