AAIController::Tick
#include "AIController.h"
Access: public
Specifiers: virtualoverride
Description
Called every frame. The AIController override drives UpdateControlRotation, which rotates the pawn toward the current focal point.
Caveats & Gotchas
- • Controllers tick by default (PrimaryActorTick.bCanEverTick = true). If you override Tick without calling Super::Tick, the pawn will stop rotating toward its focal point, breaking all focus-based AI aiming.
- • AI Tick frequency can be throttled via PrimaryActorTick.TickInterval to reduce per-frame cost on large AI populations. Setting it to 0.1 runs controller logic at 10 Hz without affecting the pawn's movement tick rate.
Signature
virtual void Tick(float DeltaTime) override Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| DeltaTime | float | Elapsed time in seconds since the last frame. | — |
Return Type
void Example
Override Tick with per-frame AI logic C++
void AMyAIController::Tick(float DeltaTime)
{
Super::Tick(DeltaTime); // drives focal-point rotation
UpdateThreatAssessment(DeltaTime);
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?