How to set a random timer that would interrupt a behaviour?

rizenmusic

New member
Hi! New to behaviour designer, just started to work with its concept after working with fsms. I'm trying to create a simple patrol behaviour:

A monster walks, it sees a wall or a ledge, it flips and go to the other side.
No problems here. What I can't figure out is how to set a timer so this monster would idle from time to time - say, every 6 to 12 seconds, to make it more alive.

I tried creating a branch with lower priority and random waits in it, but turned out it just run those waits instead of my primal branch and those don't work as timers. Instead, it should check every frame if the waiting is done and if it is then pause my patrol behaviour for a couple of seconds and then continue this cycle. Tried parallel, didn't work also. Help is much appreciated.
 

Attachments

  • 71201494c9bfa363c1fedacb7f7d926c (1).png
    71201494c9bfa363c1fedacb7f7d926c (1).png
    119.1 KB · Views: 11
I tried creating a branch with lower priority and random waits in it, but turned out it just run those waits instead of my primal branch and those don't work as timers. Instead, it should check every frame if the waiting is done and if it is then pause my patrol behaviour for a couple of seconds and then continue this cycle. Tried parallel, didn't work also. Help is much appreciated.
Conditional aborts only work on conditional tasks so because you are using an action instead of a conditional task the abort won't trigger. Conditional aborts are likely what you want to use, and you could create a new conditional task that performs functionality similar to wait except is a conditional.
 
Conditional aborts only work on conditional tasks so because you are using an action instead of a conditional task the abort won't trigger. Conditional aborts are likely what you want to use, and you could create a new conditional task that performs functionality similar to wait except is a conditional.
I made it conditional in the script just now but nothing happened. The problem is that it doesn't return success and therefore the other two actions in this sequence can't trigger. But it works with similar branch that checks raycasts. Not sure where I'm wrong: timer ticks in update and when it's over it should return success but it doesn't. Does lower priority sequence reruns the whole script every frame while evaluating and therefore it just can't finish because time is renews every frame?
 
It depends on how you created your conditional task but OnUpdate does rerun every frame so that could be why it doesn't return success if you are resetting the timer.
 
Top