Course contentsShow
← Unreal Engine Game Development
Lesson 779 of 88011. Performance Profiling and OptimizationFree lesson

Optimizing Actor Tick Rates and Intervals

Implement tick interval throttling and conditional ticking to reduce the frequency of logic updates for non-essential game objects.

In this lesson, you will learn how to reduce CPU overhead by strategically throttling Tick intervals and applying conditional logic to prevent unnecessary execution.

By default, every AActor with PrimaryActorTick.bCanEverTick enabled executes its Tick function once per frame. On a game running at 60 FPS, a simple cosmetic floating object ticks 60 times a second, which is a massive waste of Game Thread resources. For non-essential logic, such as ambient animations or background data updates, you can significantly lower this cost.

Tick Intervals

The most direct way to throttle performance is via PrimaryActorTick.TickInterval. Instead of ticking every frame, you can set an interval in seconds. For instance, setting PrimaryActorTick.TickInterval = 0.5f; ensures the actor only ticks twice per second. This is perfect for gameplay logic that doesn't require sub-frame precision, such as a distance-based AI behavior check or a resource regeneration ticker.

Conditional Ticking

Beyond fixed intervals, you should employ "Conditional Ticking" to disable actors entirely when they aren't interacting with the player. You can achieve this using SetActorTickEnabled(false). A common pattern is to use an OnOverlap event or a visibility check to toggle ticking.

// Example: Only tick when the player is nearby
void AMyOptimizedActor::NotifyActorBeginOverlap(AActor* OtherActor) {
    if (OtherActor->IsA(APlayerCharacter::StaticClass())) {
        SetActorTickEnabled(true);
    }
}

void AMyOptimizedActor::NotifyActorEndOverlap(AActor* OtherActor) {
    if (OtherActor->IsA(APlayerCharacter::StaticClass())) {
        SetActorTickEnabled(false);
    }
}

By combining TickInterval for background processes and SetActorTickEnabled for proximity-based logic, you move the Game Thread workload away from idle objects and toward active, player-facing systems. Always profile these changes using the stat Tick command to ensure the CPU time saved outweighs the logic overhead of checking conditions.

Key Takeaway: Never execute code every frame if the gameplay requirement allows for a lower frequency; use TickInterval for throttling and SetActorTickEnabled to deactivate logic entirely for distant or idle objects.