I want make my character not seen by AI, how can i do that?


I have this code for AI to detect player in my game, but I want to make my player undetected if a event "change player visibility " triggered, is it possible if I change the tag of my character to something else, or is there any other wat I can do this?