UKismetSystemLibrary::K2_GetTimerRemainingTime
#include "Kismet/KismetSystemLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Returns how much time is left in the current iteration of the timer bound to the given object/function pair.
Caveats & Gotchas
- • Returns 0.0 both for a timer that's about to fire and for a timer that doesn't exist at all — call K2_TimerExists first if you need to distinguish the two.
- • Matches the function by string name, so a typo in FunctionName silently produces 0.0 (with a logged warning) instead of a compile or runtime error.
Signature
static ENGINE_API float K2_GetTimerRemainingTime(UObject* Object, FString FunctionName) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| Object | UObject* | Object that implements the target function. Defaults to self (the blueprint the node is placed in). | — |
| FunctionName | FString | Name of the function whose timer's remaining time should be checked, matched by string against the object's function table. | — |
Return Type
float Example
Poll remaining respawn time C++
float SecondsLeft = UKismetSystemLibrary::K2_GetTimerRemainingTime(this, TEXT("HandleRespawn"));
UE_LOG(LogTemp, Log, TEXT("Respawning in %.1fs"), SecondsLeft); See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?