Problem with casting(castFailed)

I’ve got a pawnsensing component and boolean which I want to become true when I can see pawn and false when I couldn’t Everything is fine until I’m not touching cast failed exec.
So my problem is that my boolean doesn’t become false when player can’t see pawn

I just can’t understand what I’m doing wrong…

Your code basically says “when you see the pawn, if it’s an ExitGuard1 set it to true but if you see a pawn that isn’t an ExitGuard1 set it to false” apparently what you want is “when you see a pawn from class ExitGuard1 set it to true, when you don’t see him, set it to false”, can you understand your logic error? i’m not totally sure about what “OnSeePawn” does but i suppose it is only called when a pawn is seen, you need to have another event that sets it to false when it’s not seeing anything, the way it is now it will only be set to false if he sees a pawn that is not the ExitGuard1

After your explanation I know what I was doing wrong but still I don’t understand what can I do to make it work :confused:

i’m not an expert with pawnsenging, did some research and unfortunately there is not an “onNotSeeingPawn” (to use like onBeginOverlap x OnEndOverlap) function or something like this, but there are some workarounds that some people used,
i don’t have a computer with UE4 nearby so unfortunately i can’t provide much help, but in this thread you can see the workarounds i mentioned

good luck.