Sub-graph left hanging after executing the first node

I’m running into an issue where a sub-graph stops after running the first node, no matter what type of node it is.

Debug View of the Sub-Graph:

Context:

In my scenario, I have a BehaviorGraphAgent on a “Spawner” GameObject. Its graph is responsible for spawning prefabs. (hereafter referred to as SpawnerGraph)
A spawned prefab will add a “BehaviorGraphAgent” component at runtime, and assign a referenced Graph to it. (hereafter referred to as Graph)
The referenced Graph also contains a Sub-Graph. (hereafter referred to as SubGraph)

Any spawned prefab will correctly have its BehaviorGraphAgent added to it. The Graph on it will work as well, however when it reaches the first node of the SubGraph, it stops and the SubGraph remains pending.

I’ve been able to reproduce it on a clean project:

Hi,

Thanks for the report, i’m taking a look at this as a priority.

Thanks,

1 Like

Hi,

I’ve figured it out - in your PE_SimpleBehaviourizedManner you will need to call Init after spawning your agent:

We’ve not documented this very well or added any warnings to alert you to what’s happening so I’ll talk to the team and see if we can get this improved.

Sorry for the inconvenience,

Hi @hyperion2020 ,

Just adding here that @David and I are looking to simplify the API a bit so Init is implicitly called and Start isn’t called if it wasn’t initialised, but you can at least use the workaround for now :slight_smile:

Thank you very much, this works indeed. I would have never thought it would be caused by not initializing the agent because the first node was being executed successfully. Anyway thanks for your help and thank you for working on the package.

Yes, it’s definitely a bug on our side! We’re working to improve on this :sweat_smile: Thank you for the kind words and patience!

Hey @Hyperion90 ,

This should be fixed with 1.0.7 and calling Init shouldn’t be needed on your side. Can you confirm? :slight_smile:

Fantastic! Thank you for confirming :slight_smile: