AAIController::K2_ClearFocus
#include "AIController.h"
Access: public
Specifiers: UFUNCTIONBlueprintCallable
Description
Clears the controller's focus target and focal point at Gameplay priority. After calling this, the pawn's rotation will be governed by its movement direction or bSetControlRotationFromPawnOrientation. Exposed to Blueprint as 'ClearFocus'.
Caveats & Gotchas
- • Only clears EAIFocusPriority::Gameplay. If the movement system set a Move-priority focus during active path following, that focus remains active until the move completes or is aborted — the pawn will still turn toward it.
- • This is the Blueprint-safe wrapper for ClearFocus(EAIFocusPriority::Gameplay). From C++, call ClearFocus(InPriority) directly to clear a specific priority level without affecting others.
Signature
void K2_ClearFocus() Return Type
void Example
Release focus when AI target is destroyed C++
void AMyAIController::OnTargetDied()
{
TargetActor = nullptr;
K2_ClearFocus();
// Resume default rotation from movement direction
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?