Unreal Engine 5 · Blueprint → C++
Max (Int) in Unreal Engine 5 C++
The Blueprint Max (Int) node maps to UKismetMathLibrary::Max(A, B) in C++, returning the larger of two int32 values.
Blueprint node & C++ equivalent

#include "Kismet/KismetMathLibrary.h"
int32 A;
int32 B;
int32 Max = UKismetMathLibrary::Max(A, B);What does the Max (Int) node do?
The Max (Int) node returns the greater of two integers. The C++ call UKismetMathLibrary::Max(A, B) accepts two int32 arguments and returns an int32. Pair it with Min (Int) when you need to bound an integer between two endpoints.
How to use it in C++
Add #include "Kismet/KismetMathLibrary.h" and write int32 Max = UKismetMathLibrary::Max(A, B);. The templated FMath::Max(A, B) produces an identical result and avoids the KismetMathLibrary dependency if you prefer engine-core math.
Frequently asked questions
How do I get the maximum of two ints in UE5 C++?+
Call UKismetMathLibrary::Max(A, B) after including Kismet/KismetMathLibrary.h, or use FMath::Max(A, B).
Is UKismetMathLibrary::Max the same as FMath::Max?+
For int32 values they return the same larger value. UKismetMathLibrary::Max matches the Blueprint node name; FMath::Max is the templated engine core helper.