Get anim notify state duration in Blueprint

Hi,

Actually, you can get the start time but not the duration from the anim notify event with Blueprint in Editor.

However, you can create a C++ function in your BlueprintFunctionLibrary that will allow you to call it in Blueprint:

In you header file:

UFUNCTION(BlueprintPure, Category = "YourProject|Animation")
        static float GetAnimNotifyEventDuration(const FAnimNotifyEvent& NotifyEvent);

In you cpp file :

float YourClass::GetAnimNotifyEventDuration(const FAnimNotifyEvent& NotifyEvent)
{
    return NotifyEvent.GetDuration();
}

The result in blueprint :

319041-capture.png

Maybe this will be integrate by default in next engine version, but in wait ^^

1 Like