AAIController::Reset
#include "AIController.h"
Access: public
Specifiers: virtualoverrideAIMODULE_API
Description
Called when the game is reset (e.g., via 'RestartGame' or level restart). Stops the current movement and resets the AI brain to an idle state.
Caveats & Gotchas
- • Reset() is NOT called during normal possession changes or when a pawn is destroyed. It is specifically triggered by the game-level reset sequence, so it is not a reliable cleanup hook between rounds unless your game explicitly uses that flow.
- • Behavior tree execution is stopped via BrainComponent->StopLogic inside Reset(). If you restart logic in your override, call Super::Reset() first so the brain is cleanly stopped before restarting.
Signature
virtual void Reset() override; Return Type
void Example
Override to reinitialize per-round state C++
void AMyAIController::Reset()
{
Super::Reset(); // stops movement and brain
ThreatList.Empty();
CurrentTarget = nullptr;
} See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?