RealDocs

UAnimInstance::OverrideCurveValue

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

Description

Forces an animation curve to a specific value, overriding whatever the animation graph produced. The override persists until cleared or until the next frame's animation update replaces it.

Caveats & Gotchas

  • The override is applied after the animation graph evaluates curves, so it fully replaces the graph output for that curve. If other systems (morph targets, material parameters) read the curve, they will see the overridden value.
  • Must be called during the correct update phase — calling it too early (before curves are initialized) or too late (after pose finalization) has no effect. Typically call from NativeUpdateAnimation or PostUpdateAnimation.

Signature

ENGINE_API void OverrideCurveValue(const FName& CurveName, float Value);

Parameters

Name Type Description Default
CurveName const FName& Name of the animation curve to override.
Value float The value to force the curve to.

Return Type

void

Example

Override a facial expression curve from gameplay C++
void UMyAnimInstance::NativeUpdateAnimation(float DeltaSeconds)
{
    Super::NativeUpdateAnimation(DeltaSeconds);
    if (bForceSmile)
    {
        OverrideCurveValue(FName("Smile"), 1.0f);
    }
}

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.