The :on-cancel node has exactly two children. The first one is the cancel node and the second one is the payload node. It executes its payload node in a transparent manner. If the node is cancelled, that is when it goes from the :running state to the :fresh state, the cancel node is then executed.
Please note that the cancel node must succeed or fail in a single behavior tree tick.
This node is particularly usefull for releasing previously aquired resources, like a network socket for instance.
[:on-cancel [:send-event {:event :release-the-socket}]
use-socket-sub-tree]
The :on-cancel node has exactly two children.
The first one is the cancel node and the second one is the payload node.
It executes its payload node in a transparent manner. If the node is cancelled, that is
when it goes from the :running state to the :fresh state, the cancel node is then executed.
Please note that the cancel node must succeed or fail in a single behavior tree tick.
This node is particularly usefull for releasing previously aquired resources, like a network socket for instance.
```clojure
[:on-cancel [:send-event {:event :release-the-socket}]
use-socket-sub-tree]
```cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |