Download

How leave sequence after "wait" in behaviour tree

i Have this sequence that starts when “goingToDecoy” is set true, and i want to set “goingToDecoy” to false after the wait, so i created the task “LeaveDecoy” like this:

and set the key to “goingToDecoy”:

But the sequence never ends, what am I doing wrong?

The sequence should end even if you didn’t reset the bool, because you passed success back from ‘leave decoy’.

What makes you think it’s still running?

Because it doesent leave that behaviour not in visible in-game results neither in the tree:

when reaches “wait” after 3 seconds goes to “LeaveDecoy” but nothing happens here it goes back to “goToDecoy”->“Move To”-> “wait” its looping.

Im gonna try explain what I`m trying to do:
When the player activates a decoy the enemy (wich has the BT im using) enters that sequence when the BBkey “going to decoy” is set to true, then gets the location of that decoy (“goToDecoy”) and moves to that location (“Move To”) after reaching that location he waits 3seconds and then should go back to roaming by leaving that sequence

I’m wondering what’s here

If it’s another sequence node, and it’s failing to move on, it will look like this sequence node ( the one you’re asking about ), is stuck.

You can try in leave decoy to clear the decoy blackboard value
They are node for that

Hi, well it shows on the lower right that “goingToDecoy” is true and since that sequence is the one with the highest priority it will keep executing as long as both its decorators return true. So what I would do

(-) In your LeaveDecoy task, do a print to make sure it executes (I don’t see any reason why it shouldn’t execute but just to be sure…)

(-) If its executing, find where you’re setting “goingToDecoy” to true again.

1 Like

Yes you are right, it was something that was setting the value back to true back in the character blueprint, i dont remember what it was but i managed to fix it