UAnimInstance::GetDeltaSeconds
#include "Animation/AnimInstance.h"
Access: public
Specifiers: ENGINE_APIUFUNCTIONBlueprintPure
Description
Returns the delta time in seconds used for the current animation update tick. Use this instead of the world delta time when writing thread-safe animation graph logic.
Caveats & Gotchas
- • Marked BlueprintThreadSafe, so it can be called from worker-thread anim graph nodes. Calling the world's delta time APIs from those nodes is not thread-safe.
- • During the first frame after initialization, the delta time may be 0.0 or very small — guard against division-by-zero if you use this as a divisor.
Signature
UFUNCTION(BlueprintPure, Category="Animation", meta=(BlueprintThreadSafe))
ENGINE_API float GetDeltaSeconds() const Return Type
float Example
Accumulate time in a thread-safe anim graph function C++
// In a BlueprintThreadSafe function inside the anim blueprint
AccumulatedTime += GetDeltaSeconds();
if (AccumulatedTime >= CycleDuration)
{
AccumulatedTime = 0.f;
} See Also
Tags
Version History
Introduced in: 4.14
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?