Hello everyone!
I started yesterday using behaviour trees, after watching a good deal of tutorials. All looks neat and functional but I have had an inexplicable problem: making custom tasks, the “Task Wait Delay” node never finishes! If I use the normal exec output everything’s fine (but obviously it doesn’t wait at all), but if I use the On Finish exec it never ends, regardless of the time set.
I’m uploading an image of the task so you can tell me if I grossly misunderstood the node working or something else.
Thanks to everyone for your help!
I cant open the editor in the moment but is it possible that you run execute on the task again before it is finished?
Select Event Receive Execute and check the options in the details. If I remember correctly there should be a setting if the task is allowed to reset before completing execution.
Selecting the event itself doesn’t give any details, but in the behavior tree I found in the task details “Ignore restart self”, but, alas, it didn’t change anything.
Is it possible that some of the values (DelayInizio…) are not set?
Can you add a breakpoint on your TaskWaitDelay and set your DebugFilter to tell us what exactly happens.
I tried removing the link between variables and time already, and setting the delay time to 0 or 1, but none worked, so it’s not a value problem… I guess…
I added a breakpoint and, yeah, the task gets stuck at the delay node, the blueprint debugger just says that too, while the behavior tree is in the wait node (the one to delay between behaviour loops): the task appears to have failed, because the behavior tree isn’t feeding that node, and hasn’t executed the next node in the sequence, so, all decorators fail to pass because the next node was to set a bool that would make the behavior continue working.
and set your DebugFilter to tell us what exactly happens.
Soooooo… My limited knowledge of unreal debugging tools led me to search on google what the DebugFilter is, but I had no luck in finding it, so I have no idea what tool is that, and I couldn’t find it searching around in the engine (that is not surprising considered its size).
I’m sorry for being such a pain…
I leave you an image of the tree in case I wasn’t clear!
I JUST SOLVED MY ISSUE: I was typing ‘wait’, and that came out with the label “this is functionally the same as a standard delay node”, so I thought it was the Delay node for tasks. Now I wrote in another blueprint wait, and the same command came out, so I rewrote delay instead, and normal delay node came out. Using normal delay everything works fine, I just thought that that was the delay node for tasks and I couldn’t use the normal one, my bad.
But the question persists: why that node didn’t work? How is it to be used correctly? And what is its right use?
I had a similar problem. Like you said, a delay node will also work, however, if you want to use the Task Delay Node, you need to:
- Open up the advanced display for the node
- Connect a Reference To Self node to the TaskOwner parameter
The static BlueprintCallable function that creates the task has a TScriptInterface<‘IGameplayTaskOwner>’ parameter that defaults to self. Unfortunately it seems that this doesn’t work so you need to manually connect the reference to self.
Thanks for the answer! Why is this like so? Who knows! It’s one of the many arcane things one needs to find out and remember…
Task Wait Delay is for Gameplay Ability Blueprint, nothing else - It only works in Gameplay Ability Blueprint. Thats why it’s a “Gameplay Task”.