Reply To: Listening to Input events in node canvas

NodeCanvas Forums Support Listening to Input events in node canvas Reply To: Listening to Input events in node canvas

#10658
Gavalakis
Keymaster

Hey,

Glad you found a proper solution for your case and thanks for sharing.

Regarding subscribing/unsubscribing for conditions, right now, OnEnable and OnDisable is only called for conditions in FSMs, since in Behaviour Trees, there is no clear moment where a condition is enabled or disabled apart from when the BT starts and ends.
So the best candicate for subscribing, would be OnInit, and you can use OnDisable for unsubscribing for within an FSM context.
I will make OnEnable and OnDisable be called for BTs when they start and finish as well, in the next version. Added this in the TODO list.

So prety much what you have is correct right now.

As far as actions, you can once again use OnInit for subscribing and OnStop for unsubscribing if that is something needed.
Again, I will improve the API to be more consistent between both action/condition tasks and amongst all graphs regarding enabling/disablng in the next version.

Thanks!

Join us on Discord: https://discord.gg/97q2Rjh