How to deal with race conditions in behaviors?

Hey, I have a considerably small tree here:

The problem is Patrol action’s Update method gets called twice after Look At for some reason, even though this leaf should be finished, if I understand nodes correctly.

image

Also, even when the whole tree is finished, Patrol keeps running state for some reason:

I’m not sure if something is wrong with Patrol or I should organize my tree better…
Thanks!

And even though my parent Run In parallel Until Any Succeeds is finished, child action is still being running.

I’m not sure I understand how to prevent it from happening :c

Update: Okay, it seems like a debugging issue, the game works correctly.

Hey @mishakozlov74 ,

I’m sorry for the confusion caused here. Can you confirm the actual issue is that the debug icon isn’t updating correctly, or is there anything else going on I need to be aware of? :slight_smile:

Hey, not only, the bigger problem I have with Run in Parallel Until Any Succeeds.

As you can see on the screenshot above, I have a LookAt node at the end of the leaf. And even though this LookAt branch returned Success, Patrol node still gets called twice after that, essentially overwriting LookAt.

I just think that returning Success should propagate it to the parent and Patrol node shouldn’t be executed anymore.

That’s definitely a bug! I’ll investigate :slight_smile:

2 Likes

Muse is being replaced with Unity AI and all Muse experimental packages are now sunset. Read more about Unity AI here: Unity AI: AI Game Development Tools & RT3D Software | Unity