RealDocs

UKismetMathLibrary::RLerp

function Engine Blueprint Since 4.0
#include "Kismet/KismetMathLibrary.h"
Access: public Specifiers: staticUFUNCTIONBlueprintPure

Description

Linearly interpolates between rotators A and B. When bShortestPath is true the interpolation wraps each Euler component to take the shorter arc, avoiding 359°→1° spinning through 180°.

Caveats & Gotchas

  • bShortestPath operates per-component (Pitch, Yaw, Roll independently), not using quaternion SLERP — for rotations with simultaneous Pitch and Yaw changes this can still produce unexpected intermediate paths. Use quaternion SLERP (FQuat::Slerp) when path continuity matters.
  • Alpha is clamped to [0, 1] internally, so passing values outside that range has no effect — use extrapolation via FMath::Lerp directly on components if you need unclamped blending.

Signature

static ENGINE_API FRotator RLerp(FRotator A, FRotator B, float Alpha, bool bShortestPath);

Parameters

Name Type Description Default
A FRotator Start rotation (Alpha=0).
B FRotator End rotation (Alpha=1).
Alpha float Blend factor in [0, 1].
bShortestPath bool If true, interpolates via the shortest angular path for each component.

Return Type

FRotator

Example

Smoothly blend camera rotation toward target C++
FRotator NewRot = UKismetMathLibrary::RLerp(
	CurrentCameraRot,
	DesiredCameraRot,
	FMath::Clamp(DeltaTime * BlendSpeed, 0.f, 1.f),
	/*bShortestPath=*/true);
CameraComponent->SetWorldRotation(NewRot);

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.