AActor::Reset
#include "GameFramework/Actor.h"
Access: public
Specifiers: virtual
Description
Resets the actor to its initial state. Used when restarting a level without a full reload. Also fires the Blueprint event K2_OnReset.
Caveats & Gotchas
- • The default implementation does very little — it only calls K2_OnReset. All actual state restoration (health, ammo, position) must be implemented in your override. Do not rely on Reset to undo arbitrary runtime changes; it is a lightweight hook, not a full rewind.
- • Reset is called by the GameMode's ResetLevel flow. If your level restart logic relies on Reset, ensure all stateful actors (enemies, pickups) override it, or they will carry over stale state from the previous round.
Signature
virtual void Reset() Return Type
void Example
Reset actor health and position on level restart C++
void AMyEnemy::Reset()
{
Super::Reset();
Health = MaxHealth;
SetActorTransform(InitialTransform);
bIsDead = false;
SetActorHiddenInGame(false);
SetActorEnableCollision(true);
} See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?