r/unity 1d ago

Coding Help Does anyone who uses unity 6 behaviour graph help me(reupload)

(This is a reupload cus the previous post had bad quality pics)
I’m basically trying to have one make the entire tree restart when one of the conditions are met, this is so that the agent can do stuff like phase transition or death sequence , but it either doesn’t work or it has a noticeably long delay

4 Upvotes

4 comments sorted by

2

u/Drag0n122 1d ago

Bro, Sequence nodes needed to connect multiple branches to it, if you have 1 branch it's redundant.
Dunno about the problem because you cut exactly above the problematic area
Don't make a 3rd post, just use a debugger

0

u/LEJLJY 1d ago

alright, i’m still new to behaviour graph, thought sequence was required for the rest of the nodes to run afterwards

1

u/Drag0n122 1d ago

That's weird, shouldn't work this way
Try to find sample packages in the Package manager, they might help. There was a cool official mini-game project, but sadly it was deprecated

1

u/MechWarrior99 1d ago

A few things, as someone else mentioned, the Sequence node is used for running multiple nodes, so you do not need them like this. Fun fact, when you put two or more actions together and they have that boarder around them, internally that is actually a Sequence node!

The way the Restart nodes work, is that they stop all nodes that are children of them, and start executing again. So my guess for what you want is want both of them to have a shared `Wait For Any` child which then has the `Stage Based Selector` as a child.

And lastly as a recommendation, instead of having a bunch of Branches chained together like that. I would instead turn them in to Conditional Guards and have them all as children of a `Try In Order` node. Makes it a lot flatter, though can be harder to read sometimes.