Player looking at AI timer

Hi everyone, I’m new to making video games and have a few questions that hopefully you guys can answer. I’m trying to make a horror survival game and so far I have an AI that doesn’t move (yet, I want it to move is a special way) but he does rotate to stay looking at the player. I want to make it so that if the player looks at the AI for to long then the AI will rush the player and kill them. I have a variable that is set if the player has the AI in their field of view or not and it works I just can’t seem to find a way to incorporate it into the behavior tree in a way that lets me achieve my goals.

I was trying to use timers but I couldn’t find a way to clear the timer if the player looked away before the minimum time. Any help you can give will be much appreciated!

You could use a.line trace from the player to the ai

Maybe you misunderstood, I already know when the player is looking at the AI I’m having more trouble keeping a timer of how long the AI is in the players view that resets when the player looks away.

Here is a way to do it

Thanks, works much better than the way I figured out how to do it!