Navigation
API > API/Runtime > API/Runtime/Engine
The Auto destroy subsystem manages actors who have bAutoDestroyWhenFinished set as true. This ensures that even actors who do not have Tick enabled get properly destroyed, as well as decouple this behavior from AActor::Tick
| Name | UAutoDestroySubsystem |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Classes/Engine/AutoDestroySubsystem.h |
| Include Path | #include "Engine/AutoDestroySubsystem.h" |
Syntax
UCLASS ()
class UAutoDestroySubsystem : public UTickableWorldSubsystem
Inheritance Hierarchy
- FTickableObjectBase → FTickableGameObject → UTickableWorldSubsystem → UAutoDestroySubsystem
- UObjectBase → UObjectBaseUtility → UObject → USubsystem → UWorldSubsystem → UTickableWorldSubsystem → UAutoDestroySubsystem
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ActorsToPoll | TArray< TObjectPtr< AActor > > | Actors to check if they should auto destroy or not | Engine/AutoDestroySubsystem.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool RegisterActor
(
AActor* ActorToRegister |
Registers the given actor if it has the bAutoDestroyWhenFinished flag set | Engine/AutoDestroySubsystem.h | |
bool UnregisterActor
(
AActor* ActorToRemove |
Remove this actor from the array of actors to poll with this subsystem | Engine/AutoDestroySubsystem.h |
Protected
Overridden from USubsystem
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void Deinitialize() |
Implement this for deinitialization of instances of the system | Engine/AutoDestroySubsystem.h |
Overridden from FTickableObjectBase
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual TStatId GetStatId() |
Return the stat id used to track the performance of this object | Engine/AutoDestroySubsystem.h | |
virtual ETickableTickType GetTickableTickType () |
Virtual that can be overloaded by the inheriting class and is called before first tick. | Engine/AutoDestroySubsystem.h | |
virtual void Tick
(
float DeltaTime |
Update any Actors that have bAutoDestroyWhenFinished set to true. | Engine/AutoDestroySubsystem.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static bool ActorComponentsAreReadyForDestroy
(
AActor*const ActorToCheck |
Check each component on the given actor and if they are all ready for auto destroy, return true | Engine/AutoDestroySubsystem.h | |
static bool CheckLatentActionsOnActor
(
FLatentActionManager& LatentActionManager, |
Returns true if there are no latent actions on the given actor or the actor cannot have latent actions | Engine/AutoDestroySubsystem.h |