AI Perception Height

Hi guys! I’m making a stealth game wherein the player can crouch to take cover behind objects such as tables. The problem is, the player isn’t detected by the AI perception even if he is standing behind a table, where half of his body can be seen. I think this is because the AI Sight trace is blocked by the table because the end trace is pointed at the middle of the character.

So my question is, how do you adjust the height from which and to which the AI sight perception is pointing at??

Hello,

The sight perception is only activated if the agent can see the middle of the player ( I’m pretty sure it uses a trace to the center of the agent).

I am not sure if there is a simple way to do it just modifying one parameter like the height of the trace. But what you can do (see this question for further info) is make your character class derive from IAISightTargetInterface and override CanBeSeenFrom. Then in this function you can test which points you want inside. For example, in my game, I check the visibility to the head and both shoulders, since these are the topmost leftmost and rightmost points of my char.

Hope this helps,

mtrebi.

Good info. That’s an introduction into a whole new layer of the perception system. IMO this should be marked as the answer.