UWorld::GetTimerManager
#include "Engine/World.h"
Access: public
Specifiers: const
Description
Returns the FTimerManager for this world, used to schedule, cancel, pause, and query gameplay timers.
Signature
FTimerManager& GetTimerManager() const Return Type
FTimerManager& Caveats & Gotchas
- • From AActor or UActorComponent, prefer the helper GetWorldTimerManager() which also asserts that the world pointer is valid.
- • The reference is stable for the world's lifetime, but do not cache it across world transitions (e.g. PIE restart, seamless travel).
- • Timers created through this manager pause automatically when the game is paused. Use FTimerManagerTimerParameters::bIgnorePause to keep a timer running during pause.
Example
Set a repeating timer via GetTimerManager C++
FTimerHandle Handle;
GetWorld()->GetTimerManager().SetTimer(
Handle,
this,
&AMyActor::OnTimerFired,
2.0f, // every 2 seconds
true // loop
); See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?