Get the error message of a behavior graph when failure

Hi,

I am running a behavior graph from a script

agent.Graph = graph;
agent.Init();
agent.Start();

What is the recommended way to get notified when the graph failed and get the error message from the graph?

One way I could think of is to store the string message in Blackboard and retrieve it when graph.Status=Failure. But I am not sure if that will get messed up if I call the graph multiple times.

Thanks.

Hi @vincentlui ,

Currently we don’t store if a graph failed or succeeded even if a node returns fail that can be a normal operation of the graph. You can check if the graph is IsRunning (that’s in the BehaviorGraph class) and you could potentially store a variable to give a result.

I hope this helps!

Also, please note @davidlovegrove is working on improvements to the API for setting a graph which means you won’t need to call Init or Start explicitly once it lands (hopefully in the next 2 weeks).