Conditional task with both conditional abort never re-evaluates sometimes

Vergil

New member
Hi, I've encountered a really strange behaviour with conditional task + conditional abort set to both.

I've got a branch with sequence set to conditional abort "Both" like so:
1480

"Is Hesitating?" is a conditional "Float Comparison" task that is set to:
1481

The current value of that float is 0:
1482

And the "Wander" is A* Pathfinding integration task that keeps running indefinitely w/o interruptions.
I've tried adding Debug.Log("Running") to the Float Comparison task script OnUpdate, and it seems it simply do not re-evaluates.

But the cherry on top of this - it doesn't happen to every BT running.
I've got a pooling system, that basically does gameObject.SetActive(false) to the object with BT when it should be "Destroyed".
And gameObject.SetActive(true) to it when it should be "Spawned".

So this happens only if the entity has been disabled previously and re-enabled later on.

What can be causing this? Have I've ran into some rare occuring bug, or am I simply missing something?


Unity v.2019.1.8f1 / BD v1.61
 
Last edited:
So if you place a breakpoint within FloatComparison.OnUpdate the breakpoint never triggers even though Wander is running? Does it work if you don't use your pooling system?
 
So if you place a breakpoint within FloatComparison.OnUpdate the breakpoint never triggers even though Wander is running? Does it work if you don't use your pooling system?
Yes, and yes.

It does sometimes work (like 2/3 cases) after spawning entity. It could be that those different entities simply were running different branch when they've got disabled.
 
Can you send me a small repro scene that I can take a closer look at? Unfortunately I won't be able to debug this one just over the description.
 
Can you send me a small repro scene that I can take a closer look at? Unfortunately I won't be able to debug this one just over the description.
I doubt I'll be able to extract everything required for it. Its quite a decent size of a project.

I guess I need to try out different settings first and manually resetting state upon respawning. Maybe restart will prevent this.
 
Okay, so it *seems* to be working? I need to stress test a little bit more, but it doesn't look like BT is hanging constantly on the same node / branch.
I did this instead:
1485

On spawn I do .StartBehaviour() and on despawn - .DisableBehaviour().

I can only assume that pause on disable is causing this.
 
Top