RealDocs

UAnimInstance::GetUpdateCounter

function Engine Since 4.0
#include "Animation/AnimInstance.h"
Access: public Specifiers: const

Description

Returns the current animation graph update counter. Anim graph nodes use this counter to determine whether they have already been updated in the current traversal pass and avoid redundant evaluation.

Caveats & Gotchas

  • This is an engine-internal mechanism for preventing double-evaluation of shared anim graph nodes. You rarely need to call this directly unless implementing custom anim graph nodes.
  • The counter increments once per anim instance update tick. Comparing a stored counter value to the current one tells you whether a new update has occurred.

Signature

FGraphTraversalCounter GetUpdateCounter() const

Return Type

FGraphTraversalCounter

Example

Check if the anim graph has updated since last check C++
// Inside a custom anim node
FGraphTraversalCounter CurrentCounter = AnimInstance->GetUpdateCounter();
if (CurrentCounter != LastSeenCounter)
{
	LastSeenCounter = CurrentCounter;
	// Perform per-update logic
}

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.