ue-timers-and-async

Implements timers, async tasks, and background threading in Unreal Engine C++.

55|5|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/kevinpbuckley/unreal-engine-skills --skill ue-timers-and-async-kevinpbuckley
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ue-timers-and-async
Source: https://github.com/kevinpbuckley/unreal-engine-skills/tree/main/skills/core/ue-timers-and-async
Command: npx skills add https://github.com/kevinpbuckley/unreal-engine-skills --skill ue-timers-and-async-kevinpbuckley

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Unreal C++ developers frequently need to delay work, repeat callbacks, or offload heavy computation without blocking the game thread, and choosing the wrong mechanism (or misusing threads) causes crashes, GC hazards, and frame stalls. This Skill provides the correct APIs, patterns, and thread-safety rules for scheduling and async work in UE 5.8. ## Core Features & Use Cases - FTimerManager patterns: SetTimer with FTimerHandle, looping and one-shot timers, SetTimerForNextTick, pause/resume, querying, and mandatory EndPlay cleanup. - Async execution: Async/EAsyncExecution, AsyncTask/ENamedThreads, TFuture/TPromise, FNonAbandonableTask/FAutoDeleteAsyncTask/FAsyncTask, and the modern UE::Tasks system with Launch, FPipe, and dependency graphs. - Threading & ticking: FRunnable/FRunnableThread for dedicated threads, FTSTicker for non-actor ticking, and critical thread-safety rules for UObject access. - Use Case: You need to regenerate health every 0.5 seconds and run procedural generation on a background thread. Use this Skill to set up a looping timer with proper EndPlay cleanup and offload the generation via UE::Tasks::Launch, marshaling results back to the game thread safely. ## Quick Start Use the ue-timers-and-async skill to add a 3-second respawn delay timer and move my pathfinding computation to a background thread in this actor class.

Frequently Asked Questions about ue-timers-and-async

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set a repeating timer in Unreal Engine C++?

Call GetWorldTimerManager().SetTimer with an FTimerHandle member, the object and method pointer, a rate in seconds, and bLoop set to true. Store the handle so you can pause, query, or clear the timer later, and always clear looping timers in EndPlay.

How to run code on a background thread in Unreal Engine?

Use Async(EAsyncExecution::ThreadPool, Lambda) for short work or UE::Tasks::Launch for dependency-based tasks. Never touch UObjects on the worker thread; marshal results back with AsyncTask(ENamedThreads::GameThread, ...) and capture TWeakObjectPtr instead of raw pointers.

What is the difference between FTimerManager and FTSTicker?

FTimerManager is per-UWorld, respects time dilation and pausing, and suits actor gameplay logic. FTSTicker is a thread-safe global ticker for non-actor objects and subsystems, with timer-skew semantics that guarantee a minimum interval but not exact cadence.

Why does my Unreal timer crash after the actor is destroyed?

A looping timer whose lambda captures a raw this pointer does not auto-invalidate when the actor is destroyed, so it calls into freed memory. Clear every looping timer in EndPlay, since EndPlay covers destroy, level unload, and PIE end.

Can I access UObjects from a worker thread in Unreal?

No. UObject, AActor, and UActorComponent state must only be read or written on the game thread, including GetWorld, spawning, and delegate broadcasts. Capture plain data copies or TWeakObjectPtr, then validate with .Get() after returning to the game thread.

When should I use FRunnable instead of Async or UE::Tasks?

Use FRunnable with FRunnableThread only for long-running dedicated threads such as streaming, network I/O, or fixed-rate simulation loops. For bounded work that finishes and releases the thread, prefer Async with ThreadPool or UE::Tasks::Launch to share the thread pool.