RealDocs

UKismetMathLibrary::Max

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

Description

Returns the larger of two integers. Equivalent to FMath::Max for int32 but exposed to Blueprints.

Caveats & Gotchas

  • As with Min, the node is CommutativeAssociative — the engine can reorder the two inputs. Do not write pure nodes with side effects.
  • Chaining multiple Max nodes to find the maximum of N values is fine functionally, but for large N, MaxOfIntArray is more readable and has a single O(N) implementation.

Signature

static UE_INL_API int32 Max(int32 A, int32 B);

Parameters

Name Type Description Default
A int32 First value.
B int32 Second value.

Return Type

int32

Example

Ensure minimum score C++
int32 DisplayScore = UKismetMathLibrary::Max(RawScore, 0); // Never show negative

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.