UKismetSystemLibrary::K2_TimerExists
#include "Kismet/KismetSystemLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Checks whether a timer is currently set for the given object and function pair, whether it is running or paused. Shown in Blueprint as "Does Timer Exist by Function Name".
Caveats & Gotchas
- • Matches the function by binding a delegate to Object/FunctionName; if the name doesn't resolve to a UFUNCTION on Object, it logs a warning and returns false rather than erroring.
- • Returns true even if the matching timer is currently paused — use K2_IsTimerPaused if you need to distinguish a paused timer from a running one.
Signature
static ENGINE_API bool K2_TimerExists(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 should be checked, matched by string against the object's function table. | — |
Return Type
bool Example
Guard against setting a duplicate timer C++
if (!UKismetSystemLibrary::K2_TimerExists(this, TEXT("OnCooldownExpired")))
{
UKismetSystemLibrary::K2_SetTimer(this, TEXT("OnCooldownExpired"), 5.0f, false);
} See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?