Open NectoT opened 5 months ago
I've also encountered this. I found it because I have a CooldownDecorator
with a SelectorComposite
inside of it. Since after_run
never gets called on the SelectorComposite
after a SUCCESS
, it thinks the successful child node is still running, and skips all the children before it.
You can see in this screen capture how part of the subtree keeps lighting up without ever going back to the first child of the decorator's inner sequence: https://github.com/user-attachments/assets/49d3a5f9-6de1-4f33-b802-f30cd7cea3bc
I was able to work around this by subclassing CooldownDecorator and adding a call to after_run
when the superclass's tick
returns something other than RUNNING
. This got things working as expected again.
It also seems that other decorators are not consistently calling before_run
and after_run
:
CooldownDecorator
does not call after_run
DelayDecorator
does not call after_run
LimiterDecorator
does not call before_run
UntilFailDecorator
does not call after_run
ReapeaterDecorator
calls before_run
one time, but calls after_run
after each repetition that returns SUCCESS
or FAILURE
(I'm unsure which of these is correct, but I would expect them to match.)
Godot version: 4.2.1
To Reproduce Steps to reproduce the behavior:
DelayDecorator
orCooldownDecorator
as its childfunc tick(actor: Node, blackboard: Blackboard) -> int: return SUCCESS
func after_run(actor: Node, blackboard: Blackboard) -> void: print('I finished running')