RealDocs

UBehaviorTreeComponent::GetAccumulatedTickDeltaTime

function AIModule Since 4.0
#include "BehaviorTree/BehaviorTreeComponent.h"
Access: public Specifiers: constinline

Description

Returns the total delta time accumulated for the current tick, accounting for any frames that were skipped due to ScheduleNextTick throttling.

Caveats & Gotchas

  • Use this instead of the raw DeltaTime passed to TickTask when the tree has been throttled — it reflects the real elapsed time since the last processed tick, not just one frame.
  • Only meaningful while a tick is actively being processed; calling it outside that context returns whatever value was last accumulated.
  • Defined inline in the header as a simple accessor over the private AccumulatedTickDeltaTime member.

Signature

float GetAccumulatedTickDeltaTime() const { return AccumulatedTickDeltaTime; }

Return Type

float

Example

Use accumulated delta time in a throttled task C++
void UMyTask::TickTask(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory, float DeltaSeconds)
{
	const float RealDelta = OwnerComp.GetAccumulatedTickDeltaTime();
	// Use RealDelta instead of DeltaSeconds when the tree is throttled
}

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.