Reply To: Start/Stop BTOwner by script

NodeCanvas Forums Support Start/Stop BTOwner by script Reply To: Start/Stop BTOwner by script

#13448
Gavalakis
Keymaster

Hello again,

Considering I understood correctly, this is actually pretty easy to do 🙂

The BehaviourTreeOwner (or any GraphOwner for that matter), has a “StartBehaviour” overload that takes a System.Action<bool> argument as a callback. As such, when (for any reason, even by the included ControlGraphOwner action task) the behaviour is stopped, the callback will be called. For example:

Thus the “trick” here, is simply to provide a callback when the behaviour starts. Ending the behaviour can be done in any way and the callback will still be called.

Please let me know if that works for you.
Thanks!

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