How to handle tree if node is stuck on "TaskStatus.Running"?

syu15

New member
Hello,
We started playtesting and have discovered sometimes our nodes get stuck on "TaskStatus.Running" indefinitely (it is a bug with our code, not the asset to be clear). Of course we will try to fix the bugs causing this behavior, but as a last resort, is there a way to restart the behavior tree if any particular node is running for too long?
Thanks!
 
There isn't any built in logic to stop the tree since often times it's wanted that the task continuously returns a status of running. With that said, you could either develop your own way of handling this use case or use conditional aborts to trigger an interrupt when it detects that the task is running but it shouldn't be.
 
Is there an API or something I can use to detect how long a task has been running? Just trying to figure out how I would building something like this myself.
 
You can use BehaviorTree.FindTask to find a specific task, but there isn't anything within the API that allows you to search for a task status. The runtime source is available though if you'd like to add it.
 
Top