{ }Blueprint → C++

Unreal Engine 5 · Blueprint → C++

In Range in Unreal Engine 5 C++UE Docs

The In Range Blueprint node checks whether a value falls between a minimum and maximum. In C++ it is just (Value >= Min && Value <= Max), or UKismetMathLibrary::InRange_FloatFloat(Value, Min, Max).

Blueprint node & C++ equivalent

C++
bool bInRange = (Value >= Min && Value <= Max);
// or: UKismetMathLibrary::InRange_FloatFloat(Value, Min, Max)

What does the In Range node do?

In Range returns a boolean that is true when a value sits between a lower and upper bound. The Blueprint node also exposes Inclusive Min and Inclusive Max pins that decide whether the endpoints themselves count as in range.

By default both endpoints are inclusive, which maps directly to a >= and <= comparison in C++.

The C++ equivalent

The most direct translation is a plain comparison: bool bInRange = (Value >= Min && Value <= Max);. This compiles to a couple of cheap comparisons and skips any function-call overhead.

If you want to mirror the Blueprint node exactly, call UKismetMathLibrary::InRange_FloatFloat(Value, Min, Max, bInclusiveMin, bInclusiveMax). The two bool parameters default to true, matching the node's default inclusive behavior.

When to use it

Use the raw comparison in hot paths such as Tick or tight loops where you do not need the inclusive toggles. Reach for UKismetMathLibrary::InRange_FloatFloat when you specifically need exclusive endpoints or want code that reads identically to the graph it replaced.

Frequently asked questions

How do I check if a value is in range in UE5 C++?+

Write bool bInRange = (Value >= Min && Value <= Max); for an inclusive check, or call UKismetMathLibrary::InRange_FloatFloat for the exact Blueprint behavior including the inclusive-min and inclusive-max toggles.

Is In Range inclusive or exclusive in Unreal?+

By default both endpoints are inclusive, so Value == Min and Value == Max both return true. The C++ function InRange_FloatFloat lets you set bInclusiveMin and bInclusiveMax to false to make either endpoint exclusive.

Related Math nodes

View all Math nodes →