RealDocs

UKismetMathLibrary::MapRangeUnclamped

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

Description

Linearly remaps Value from one range to another without clamping. A value of 20 in [10,50] mapped to [20,40] returns 25. Values outside the input range extrapolate beyond the output range.

Caveats & Gotchas

  • No clamping is applied — inputs outside [InRangeA, InRangeB] produce outputs outside [OutRangeA, OutRangeB]. This is intentional for extrapolation use cases but unexpected when you assume bounded inputs.
  • If InRangeA == InRangeB the function divides by zero. Validate that the input range is non-degenerate, especially when both bounds come from runtime data.

Signature

static ENGINE_API double MapRangeUnclamped(double Value, double InRangeA, double InRangeB, double OutRangeA, double OutRangeB);

Parameters

Name Type Description Default
Value double The value to remap.
InRangeA double Start of the input range.
InRangeB double End of the input range.
OutRangeA double Start of the output range.
OutRangeB double End of the output range.

Return Type

double

Example

Remap joystick analog input to camera pan speed C++
float AxisValue = 0.75f;
double PanSpeed = UKismetMathLibrary::MapRangeUnclamped(AxisValue, -1.0, 1.0, -200.0, 200.0); // returns 150.0

Tags

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.