AActor::SetActorTickEnabled
#include "GameFramework/Actor.h"
Access: public
Specifiers: virtualUFUNCTIONBlueprintCallable
Description
Enables or disables this actor's primary tick function at runtime. Disabling tick on idle actors is a cheap optimisation — the function must be registered first.
Caveats & Gotchas
- • Has no effect if the tick function is not registered (i.e., PrimaryActorTick.bCanEverTick was false at construction time). Check IsActorTickEnabled() to confirm the result.
- • Only modifies the actor's own tick function. Components retain their own enabled/disabled state and must be toggled separately.
- • Re-enabling tick does not reset the tick interval — the last value set by SetActorTickInterval() remains in effect.
Signature
virtual void SetActorTickEnabled(bool bEnabled) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| bEnabled | bool | Whether the actor's primary tick function should be enabled. | — |
Return Type
void Example
Disable tick on a dormant enemy C++
void AEnemy::OnEnteredSleepState()
{
SetActorTickEnabled(false);
}
void AEnemy::OnWokeUp()
{
SetActorTickEnabled(true);
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?