No, you don’t. You can do it, but it is a bad solution.
What you need to do is to create a bool variable. When player goes invisible you need to set it. And when AI executes On See Pawn cast to player and chek this variable.
You need to create bool inside players charecter.