{ }Blueprint → C++

Unreal Engine 5 · Blueprint → C++

Max (Float) in Unreal Engine 5 C++

The Blueprint Max (Float) node maps to UKismetMathLibrary::FMax(A, B) in C++, returning the larger of two float values.

Blueprint node & C++ equivalent

Max (Float) Blueprint node and its C++ equivalent in Unreal Engine 5
The “Max (Float)” Blueprint node.
C++
#include "Kismet/KismetMathLibrary.h"

float A;
float B;

float Max = UKismetMathLibrary::FMax(A, B);

What does the Max (Float) node do?

Max (Float) returns the higher of two floating-point numbers. The C++ equivalent UKismetMathLibrary::FMax(A, B) takes two float arguments and returns a float. The F prefix marks the float overload, mirroring the FMin used for Min (Float).

How to use it in C++

Add #include "Kismet/KismetMathLibrary.h" and write float Max = UKismetMathLibrary::FMax(A, B);. The engine-core FMath::Max(A, B) template returns the same float maximum and avoids depending on the Kismet library.

Frequently asked questions

How do I get the maximum of two floats in UE5 C++?+

Use UKismetMathLibrary::FMax(A, B) from Kismet/KismetMathLibrary.h, or the templated FMath::Max(A, B).

What is the difference between FMax and Max in Unreal?+

FMax is the float-specific KismetMathLibrary helper, while Max is the integer version. FMath::Max is templated and works for both.

Related Math nodes

View all Math nodes →