RealDocs

UAnimInstance::GetLastMontageFlushFrame

function Engine Since 5.0
#include "Animation/AnimInstance.h"
Access: public Specifiers: ENGINE_API

Description

Returns the frame counter value from the last time completed montages were flushed. Useful for detecting whether a flush has occurred since a previous checkpoint, enabling code to avoid redundant processing of montage state.

Caveats & Gotchas

  • The returned value is a raw GFrameCounter snapshot — it increments every engine frame, not every animation tick. On frames where animation is URO-skipped, this value will not update even though game time has advanced.
  • Do not persist this value across level transitions or seamless travel, as the frame counter resets and comparisons against stale values will produce incorrect results.

Signature

ENGINE_API uint64 GetLastMontageFlushFrame() const;

Return Type

uint64

Example

Check if montages were flushed since last check C++
void UMyAnimInstance::CheckMontageFlush()
{
	const uint64 CurrentFlushFrame = GetLastMontageFlushFrame();
	if (CurrentFlushFrame != LastKnownFlushFrame)
	{
		LastKnownFlushFrame = CurrentFlushFrame;
		// Montages were flushed — refresh cached state
		RefreshMontageState();
	}
}

Version History

Introduced in: 5.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.