Can AIPerception Peripheral Vision Angle Degrees be changed at Run Time using C++

Hi

I have AI that do a dive tackle to subdue the player but if the AIPerception sight is set to 90 degrees when they tackle and if they miss tackle and go past the player they stand up with the player behind them cause they can’t see the player anymore they go back to patrolling.
So what I would like to do is set the angle to 90 degrees as normal but once the player has been sighted change it to 180 degrees then after miss tackle the AI will turn around and pursue the player again but when line of sight to the player is lost then set the angle back to 90 degrees.

BP’s has no node to change AIPerception Peripheral Vision Angle Degrees, I need to know if this value can be changed at run time using C++, before I install Visual Studios

Thanx GARTH

I really really need an answer to this question before I install C++.

Hello,

Have a look at this API documentation: https://docs.unrealengine.com/latest/INT/API/Runtime/AIModule/Perception/UAIPerceptionComponent/PeripheralVisionAngle/index.html

It states that yes, the value can be changed at runtime using the SetPeripheralVisionAngle function.

EDIT: After speaking with our developers, it appears that the PeripheralVisionAngle property is deprecated, and will not work anymore. What you’ll need to do is update the sense config through C++ and then get the perception component to reconfigure. If you’re not familiar with C++ coding, I’d recommend starting with some simpler tutorials to get your feet wet before jumping into this particular task.

Have a great day

1 Like