Camera target AI-Character


I have two problems relating to targeting NPCs in my scene. The first is that I need to track an AI bot as it patrols the scene. I am using this tutorial but it only covers how to track a player controlled character.

The tutorial recommends creating a Actor reference variable in the camera blueprint, and setting to Get Player Pawn on begin play. What should I plug in to set it to the AI-Character instead?

My second problem is that there are objects in my scene that the AI senses and walks over to. I’d like to change the camera orientation so that it centres these objects in the field of view based on a box trigger, does anyone have any advice on that?

Any help is greatly appreciated.

put more simply how do you get a camera to track something other than the player?

You need to get the reference of the AI character somehow. Then you can use Set Target View With Blend to watch from the AI’s camera. As for the camera rotation, you can get the location of the object, and use Look at Rotation(or Find Rotation, something like that, I don’t remember exactly at the moment), and rotate the camera accordingly.

Hi did you ever figure this problem out at all? I know you can get the Ai controller which may work instead of the player controller however my issue is the Ai I want to target with the camera does not spawn on begin play and enters after therefore I have no idea how to get a reference to the Ai character?