FTimerManager::GetTimerRemaining
#include "TimerManager.h"
Access: public
Specifiers: inlineconst
Description
Returns the time in seconds until the timer's next fire. Returns -1.f if the timer does not exist or the handle is invalid.
Signature
float GetTimerRemaining( FTimerHandle InHandle ) const Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| InHandle | FTimerHandle | Handle of the timer to query. | — |
Return Type
float Caveats & Gotchas
- • For a looping timer, this returns the time until the next repeat, not a cumulative lifetime.
- • Always check for -1.f before using the result — cleared and invalid handles both return -1.f, not 0.
- • For a paused timer, this returns the remaining time as of when the pause occurred (i.e., how long is left once resumed).
Example
Display cooldown countdown in a HUD C++
float Remaining = GetWorldTimerManager().GetTimerRemaining(CooldownHandle);
if (Remaining >= 0.f)
{
CooldownText->SetText(FText::FromString(
FString::Printf(TEXT("%.1f"), Remaining)
));
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?