Download

How to check if NPC no longer sees player?

In the character blueprint there is an On See Pawn event that I can use to set variables that can be accessed in the animation blueprint, so the NPC goes from idle to running animation when it sees the player, but when he breaks line of sight, the NPC keeps playing the running/attacking animation even though he is back to idle state. How do i check if the NPC is NOT seeing the player and use that to update the variable in my animation blueprint?

OnSeePawn->bSeePawn = true->Timer(SensingInterval +0.1)->bSeePawn = false

I tried it but it makes the NPC keep playing the "player spotted"animation repeatedly. What i meant was if there is an event that is the exact opposite of On See Pawn, it doesn’t exucute anything on its own, it just tells me “does the AI see the player or not?”. Thanks anyway.