{ }Blueprint → C++

Unreal Engine 5 · Blueprint → C++

Lerp in Unreal Engine 5 C++

The Blueprint Lerp node maps to FMath::Lerp(A, B, Alpha) in C++, linearly interpolating from A to B by an Alpha factor.

Blueprint node & C++ equivalent

Lerp Blueprint node and its C++ equivalent in Unreal Engine 5
The “Lerp” Blueprint node.
C++
float A;
float B;
float Alpha;

float Result = FMath::Lerp(A, B, Alpha);

What does the Lerp node do?

Lerp performs linear interpolation between A and B. With Alpha at 0 it returns A, at 1 it returns B, and at 0.5 it returns the midpoint. The formula is A + Alpha * (B - A), and FMath::Lerp(A, B, Alpha) evaluates it for you.

How to use it in C++

Call float Result = FMath::Lerp(A, B, Alpha);. FMath::Lerp is templated and also works on types like FVector, FRotator, and FLinearColor. Alpha is not automatically clamped, so values outside 0 to 1 will extrapolate beyond A and B.

Frequently asked questions

What is the C++ equivalent of the Lerp node in UE5?+

It is FMath::Lerp(A, B, Alpha), which returns the linear interpolation between A and B based on Alpha.

Does FMath::Lerp clamp the Alpha value?+

No. FMath::Lerp extrapolates if Alpha is outside 0 to 1; clamp Alpha first with FMath::Clamp if you need to stay within A and B.

Related Math nodes

View all Math nodes →