UKismetAnimationLibrary::K2_CalculateVelocityFromPositionHistory

This function calculates the velocity of a position changing over time.

Windows
MacOS
Linux

References

Module

AnimGraphRuntime

Header

/Engine/Source/Runtime/AnimGraphRuntime/Public/KismetAnimationLibrary.h

Include

#include "KismetAnimationLibrary.h"

Source

/Engine/Source/Runtime/AnimGraphRuntime/Private/KismetAnimationLibrary.cpp

Syntax

static float K2_CalculateVelocityFromPositionHistory
(
    float DeltaSeconds,
    FVector Position,
    FPositionHistory & History,
    int32 NumberOfSamples,
    float VelocityMin,
    float VelocityMax
)

Remarks

This function calculates the velocity of a position changing over time. You need to hook up a valid PositionHistory variable to this for storage.

Parameters

Parameter

Description

DeltaSeconds

The time passed in seconds

Position

The position to track over time.

History

The history to use for storage.

NumberOfSamples

The number of samples to use for the history. The higher the number of samples - the smoother the velocity changes.

VelocityMin

The minimum velocity to use for normalization (if both min and max are set to 0, normalization is turned off)

VelocityMax

The maximum velocity to use for normalization (if both min and max are set to 0, normalization is turned off)

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss