Navigation
Unreal Engine C++ API Reference > Runtime > Engine > FTimerManager > SetTimer
References
Module | Engine |
Header | /Engine/Source/Runtime/Engine/Public/TimerManager.h |
Include | #include "TimerManager.h" |
template<class UserClass>
void SetTimer
(
FTimerHandle & InOutHandle,
UserClass * InObj,
typename FTimerDelegate::TMethodPtr< UserClass > InTimerMethod,
float InRate,
bool InbLoop,
float InFirstDelay
)
Remarks
Sets a timer to call the given native function at a set interval. If a timer is already set for this handle, it will replace the current timer.
Parameters
Name | Description |
---|---|
InOutHandle | If the passed-in handle refers to an existing timer, it will be cleared before the new timer is added. A new handle to the new timer is returned in either case. |
InObj | Object to call the timer function on. |
InTimerMethod | Method to call when timer fires. |
InRate | The amount of time (in seconds) between set and firing. If <= 0.f, clears existing timers. |
InbLoop | true to keep firing at Rate intervals, false to fire only once. |
InFirstDelay | The time (in seconds) for the first iteration of a looping timer. If < 0.f InRate will be used. |