AAIController::PostInitializeComponents
#include "AIController.h"
Access: public
Specifiers: virtualoverride
Description
Called after all components are initialized. The AIController override registers with the AI system and sets up the team ID.
Caveats & Gotchas
- • Always call Super::PostInitializeComponents() when overriding. Skipping it prevents the AI subsystem from registering this controller, causing MoveToActor and MoveToLocation to fail silently because no navigation agent is registered.
- • This fires in the editor for editor-spawned actors as well as at PIE/runtime. Code here must be safe for editor contexts — do not access runtime-only world subsystems unconditionally.
Signature
virtual void PostInitializeComponents() override Return Type
void Example
Configure AI flags early in initialization C++
void AMyAIController::PostInitializeComponents()
{
Super::PostInitializeComponents();
// Components are initialized; world subsystems may not exist yet
bAllowStrafe = true;
bSkipExtraLOSChecks = true;
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?