FTimerManager::K2_FindDynamicTimerHandle
#include "TimerManager.h"
Access: public
Specifiers: ENGINE_API
Description
Searches the timer manager for a timer bound to the given dynamic delegate and returns its handle. Returns an invalid handle if no such timer exists. Intended for use by the Kismet (K2) Blueprint system.
Caveats & Gotchas
- • This function performs a linear scan over all timers to match the delegate — it is O(n) in the number of active timers. Do not call it per-frame or in hot loops.
- • The K2_ prefix signals that this function is part of the internal Blueprint scripting interface. Prefer keeping a FTimerHandle in your own C++ code rather than using this lookup.
Signature
ENGINE_API FTimerHandle K2_FindDynamicTimerHandle(FTimerDynamicDelegate InDynamicDelegate) const Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| InDynamicDelegate | FTimerDynamicDelegate | The dynamic delegate whose associated timer handle to look up. | — |
Return Type
FTimerHandle Example
Retrieve a handle for a dynamic delegate C++
// Typically used internally by UKismetSystemLibrary; shown here for completeness.
FTimerDynamicDelegate Del;
Del.BindUFunction(this, FName("MyTimerCallback"));
FTimerHandle Handle = GetWorld()->GetTimerManager().K2_FindDynamicTimerHandle(Del);
if (Handle.IsValid())
{
GetWorld()->GetTimerManager().ClearTimer(Handle);
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?