FTimerManager::HasBeenTickedThisFrame
#include "TimerManager.h"
Access: public
Specifiers: inline
Description
Returns true if this timer manager has already been ticked during the current frame. Useful for subsystems that want to avoid double-ticking a shared timer manager.
Caveats & Gotchas
- • Comparison is done against GFrameCounter, which is a global engine frame counter. If you call this outside of the game thread, GFrameCounter may be mid-update and the result is unreliable.
- • Returns false in the first frame before the manager's first Tick call, which can mislead initialization code that checks it eagerly.
Signature
bool inline HasBeenTickedThisFrame() const Return Type
bool Example
Guard against double-tick C++
void UMySubsystem::Tick(float DeltaTime)
{
FTimerManager& TM = GetWorld()->GetTimerManager();
if (!TM.HasBeenTickedThisFrame())
{
// perform work that depends on timers being current
}
} See Also
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?