I am trying to make a mechanic that allows you to hide for example in the bushes from enemy. Enemy uses AI perception and I was thinking how can I make it that even if the enemy sees player, he “doesn’t” see him.
My own answer would be by turning stimulus off. I just don’t have any idea how to do it runtime.
It can keep “seeing” but just stop the execution of events that the AI takes action according to the player, like facing to it or walking towards it or aiming or anything! You can achieve this simply by using a boolean type variable and binding it before such events in the execution chain. (or abort tasks if you’re using behavior tree)
What I mentioned above is more than enough to solve your issue but just to give something extra, you can change how the perception system works by overriding it’s functions using C++ but like I said, it’s not necessary in this case. You would need to use it if you wanted something like, changing it’s FOV for instance
In your AI sight pereception you could call a line trace from the AI actor to player, if it collides with something other than player don’t assign a target