Announcement

Collapse
No announcement yet.

Camera target AI-Character

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Camera target AI-Character

    Hi,

    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 https://www.youtube.com/watch?v=si58...yiXKogjtvzPORM 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.
    Attached Files

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

    Comment


      #3
      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.

      Comment


        #4
        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?

        Comment

        Working...
        X