RealDocs

UAnimInstance::GetCurveValue

function Engine Blueprint Since 4.14
#include "Animation/AnimInstance.h"
Access: public Specifiers: UFUNCTIONBlueprintPure

Description

Returns the current evaluated value of a named animation curve. Returns 0.0 if the curve is not found or not active.

Caveats & Gotchas

  • • Returns 0.0 silently if the curve name doesn't exist — use GetCurveValueWithDefault() or the non-Blueprint overload that returns bool if you need to distinguish 'not found' from 'value is zero'.
  • • Curve values are only valid after the anim graph has ticked for the current frame. Reading them from BeginPlay or in the same frame the mesh activates may return 0.
  • • Marked BlueprintThreadSafe — safe to call from animation thread contexts.

Signature

float GetCurveValue(FName CurveName) const

Parameters

Name Type Description Default
CurveName FName Name of the animation curve to read. —

Return Type

float

Example

Read a footstep weight curve C++
if (UAnimInstance* AnimInst = GetMesh()->GetAnimInstance())
{
    float FootL = AnimInst->GetCurveValue(FName("FootstepLeft"));
    if (FootL > 0.5f)
    {
        PlayFootstepSound(EFoot::Left);
    }
}

Version History

Introduced in: 4.14

Version Status Notes
5.6 stable —

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.