Character AI Perception

Hello, i have this zombie character with this AI Stimuli in which i have this code setting a “has Sensed” variable (se Graph) it works fine when it comes to attack the player but i cant make it play a Scream montage before it attacs.

can you help me?

Hey there @TostOn123! Welcome back to the community! Does the blackboard variable change correctly in the behavior tree? Could we see where you trigger the montage as well?

I don’t have it in my blackboard,
I was thinking I could use the variable now that I have it.

So i could say: the zombie character has seen? if true then play this quick scream montage, else, keep doing your regular stuff. (behavior tree)

So… here are my Scream Task and its place in the behavior tree.
interesting is that the Anim Montaje Works fine but not in the task.

I put the attack montage instead to test if the code was right and it worked.
the Scream animation also works fine if i use it separated


Any Idea?

Interesting! The montage works when entirely separate from the behavior system, but fails if triggered as a BTTASK. Does that Zombie Scream event/function tied to the task fire at all? You can check with a breakpoint or a print statement on it. Tying to discern if the montage is failing or getting the function to run through the task failing.

If I assign the “Play Animation” Built in task in the Black Board, the animation plays well.

Now check this graph, here I’m blending the attack montage with the walking movement.
if I replace the attack for the scream. it works fine, but only the upper body, so the montage will play incomplete wothout the second half of the body.

but otherwise it wont show at all. Maybe I need to re-do this. All i need is to make the zombie play this animation when he detects the player.