Download

AI sight perception vertical angle

I’m using the AIPerception component for my AI character and using sight as one of the senses. The issue is that the PeripheralVisionHaflAngleDegrees only defines the horizontal FOV of the AI’s sight, but not the vertical FOV. This causes the AI to lose sight of the player just by crouching or jumping. There has to be a way to increase the vertical FOV so that the AI can see Up and down as well. How would I be able to do this?

I guess you should use SetFocus or SetFocalPoint when your AI spot something.

1 Like

Thanks for the reply. While that would work when the AI is chasing the player, it wouldn’t work as well when the AI is in its patrol state and has no focal point. At that point, the player would be able to crouch right in front of the AI and not intersect with the AI’s line of sight and not get detected, which is not what I want.

It sounds natural that the bot focuses on any spoted threat when he sees it. If you don’t want him to rotate toward threat position, may be you can decouple the Controller rotation & Pawn rotation using CharacterMovementComponent->bUseControllerRotation = false while he’s not moving? Then you can SetFocus on target.