I’m following a tutorial to make a zombie AI and I’m using behaviour tree and blackboard. I already have some tasks to follow the player and wander randomly, but I’m having some problems to make the damage part works.
I did like that:
Put two box collisions in each hand of the TPC
I make and custom event to trigger the animation of the attack
I’m checking in the zombie character whenever enter in a collision with player it casts to TPC and check if is punching, then setting value (DAMAGE) as bool in blackboard.
In the behaviour tree I have a selector and a sequence with blackboard decorator with the condition damage is is set, that leads to a task that only print some text.
When I punch the zombie for the first time, the variable DAMAGE turns true, then turns false. It should remains false, but for some reason it turns true again and remain like that. And then they get stucked in the task forever.
Basically, when I punch the variable do: true, false, true, true, true…
I tried to manually set it to false in actor end overlap, but it doesn’t worked.
I can’t figure it out how to solve this.
Punch event: Imgur: The magic of the Internet
My blackboard: Imgur: The magic of the Internet
Overlap events: Imgur: The magic of the Internet