Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/UKismetSystemLibrary
Description
Set a timer to execute delegate. Setting an existing timer will reset that timer with updated parameters.
| Name | K2_SetTimer |
| Type | function |
| Header File | /Engine/Source/Runtime/Engine/Classes/Kismet/KismetSystemLibrary.h |
| Include Path | #include "Kismet/KismetSystemLibrary.h" |
| Source | /Engine/Source/Runtime/Engine/Private/KismetSystemLibrary.cpp |
UFUNCTION (BlueprintCallable,
Meta=(DisplayName="Set Timer by Function Name", ScriptName="SetTimer", DefaultToSelf="Object", AdvancedDisplay="InitialStartDelay, InitialStartDelayVariance"),
Category="Utilities|Time")
static FTimerHandle K2_SetTimer
(
UObject * Object,
FString FunctionName,
float Time,
bool bLooping,
bool bMaxOncePerFrame,
float InitialStartDelay,
float InitialStartDelayVariance
)
The timer handle to pass to other timer functions to manipulate this timer.
Parameters
| Name | Remarks |
|---|---|
| Object | Object that implements the delegate function. Defaults to self (this blueprint) |
| FunctionName | Delegate function name. Can be a K2 function or a Custom Event. |
| Time | How long to wait before executing the delegate, in seconds. Setting a timer to <= 0 seconds will clear it if it is set. |
| bLooping | True to keep executing the delegate every Time seconds, false to execute delegate only once. |
| bMaxOncePerFrame | For looping timers, whether to execute only once when the timer would otherwise expires multiple times in the current frame. |
| InitialStartDelay | Initial delay passed to the timer manager to allow some variance in when the timer starts, in seconds. |
| InitialStartDelayVariance | Use this to add some variance to when the timer starts in lieu of doing a random range on the InitialStartDelay input, in seconds. |