Navigation
API > API/Plugins > API/Plugins/AnimationLocomotionLibraryRuntim- > API/Plugins/AnimationLocomotionLibraryRuntim-/UAnimDistanceMatchingLibrary
Description
Set the time of the sequence evaluator to the point in the animation where the distance curve matches the DistanceToTarget input. A common use case is to achieve stops without foot sliding by, each frame, selecting the point in the animation that matches the distance the character has remaining until it stops. Note that because this technique sets the time of the animation by distance remaining, it doesn't respect phase of any previous animation (e.g. from a jog cycle).
| Name | DistanceMatchToTarget |
| Type | function |
| Header File | /Engine/Plugins/Animation/AnimationLocomotionLibrary/Source/Runtime/Public/AnimDistanceMatchingLibrary.h |
| Include Path | #include "AnimDistanceMatchingLibrary.h" |
| Source | /Engine/Plugins/Animation/AnimationLocomotionLibrary/Source/Runtime/Private/AnimDistanceMatchingLibrary.cpp |
UFUNCTION (BlueprintCallable, Category="Distance Matching", Meta=(BlueprintThreadSafe))
static FSequenceEvaluatorReference DistanceMatchToTarget
(
const FSequenceEvaluatorReference & SequenceEvaluator,
float DistanceToTarget,
FName DistanceCurveName
)
Parameters
| Name | Remarks |
|---|---|
| SequenceEvaluator | The sequence evaluator node to operate on. |
| DistanceToTarget | The distance remaining to a target (e.g. a stop or pivot point). |
| DistanceCurveName | Name of the curve we want to match |