RealDocs

AAIController::SetFocalPoint

function AIModule Since 4.8
#include "AIController.h"
Access: public Specifiers: virtualAIMODULE_API

Description

Sets a world-space position as the focal point at the given priority. The pawn's control rotation is updated to face this point each tick, with higher-priority slots overriding lower ones.

Caveats & Gotchas

  • SetFocalPoint sets a static world position. If the intended target moves, the AI will not track it — use SetFocus(Actor) to track a moving actor continuously.
  • In Blueprint, the K2_SetFocalPoint wrapper (exposed as 'Set Focal Point') always writes to the Gameplay priority slot. The C++ version provides access to the full priority system.

Signature

virtual void SetFocalPoint(FVector NewFocus, EAIFocusPriority::Type InPriority = EAIFocusPriority::Gameplay);

Parameters

Name Type Description Default
NewFocus FVector World-space position the AI should look toward.
InPriority EAIFocusPriority::Type Priority slot to assign the focal point to. Defaults to Gameplay priority. EAIFocusPriority::Gameplay

Return Type

void

Example

Make AI look at a fixed position while moving C++
SetFocalPoint(DoorLocation, EAIFocusPriority::Gameplay);
MoveToLocation(DestinationBeyondDoor);

Version History

Introduced in: 4.8

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.