Help with adding a delay please

burglebutt

New member
Hello! I have hit a dead end here trying to figure out what to do. This behavior tree works but my issue is that I want to add in some sort of delay between each task under the random selector for my Enemies AI. As it is right now it is trying to fire all them off at every chance it gets.

I tried putting a Behavior Manager on the same game object that has the behavior tree. I set the Behavior Manager to seconds but its disabled in the editor when its set to anything except the Update Instantly setting and I am not sure it would matter anyways because it still wants to fire them all off at the same time.I tried to add a Wait but it doesn't branch off to a child and putting it in between the conditionals didn't seem to help much.

The conditionals here check the distance between the player and the enemy so if the enemy is close it should do the left hand swipe and right hand swipe and if its further away the double swipe and barf attack. Ideally I would like for the enemy AI to make a choice between attakcing with its left hand or right hand but not at the same time. Ideally I would also like the Double Swipe and Barf attack to just have a chance of happening rather than just happening immediately when the distance condition is met.


Can anybody help guide me on what to do. I really like Behavior Designer but I am still a noob and the complexity of it makes my brain hurt :3 any help would be huge and greatly appreciated, thank you! ?







Behavior tree.png
 
Last edited:
Under the repeater you could place a Sequence task and then put a Wait task immediately before the Random Selector. This will add the delay before each action.
 
Top