Download

Rotate AIPerception Component

Hi,

Is there a way to rotate the AIPerception Component?
I have an animation play where my character is looking around and I want the AIPerception Component to move with the head rotation.

Thanks!

Unfortunately, it’s not as straightforward as it should be given that a characters sight perception is very depending on which way the characters head is rotated. Seems like an obvious feature for Epic to add.

The way I did it was to create an empty actor blueprint and add the AIPerception component to that. I called it “Senses” or something like that.

Then I added the Senses as a child of my Character blueprint.

Then inside the Senses blueprint I match its world position and rotation to a bone/socket in my characters head and update this position and rotation on tick.

This works but it adds a lot of additional complexity because:

  1. You have to handle all the communication between the Senses actor and the Character
  2. The debug display for AIPerception doesn’t seem to work unless its added directly to a character. Therefore I had to handle drawing any useful debug data myself, inside of the Senses actor blueprint.

Here is the end result:

https://youtube.com/watch?v=3gGNi0iYAxk