UKismetMathLibrary::ClampAngle

Clamps an arbitrary angle to be between the given angles. Will clamp to nearest boundary.

Windows
MacOS
Linux

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Kismet/KismetMathLibrary.h

Include

#include "Kismet/KismetMathLibrary.h"

Source

/Engine/Source/Runtime/Engine/Classes/Kismet/KismetMathLibrary.inl

Syntax

static float ClampAngle
(
    float AngleDegrees,
    float MinAngleDegrees,
    float MaxAngleDegrees
)

Remarks

Clamps an arbitrary angle to be between the given angles. Will clamp to nearest boundary.

Returns

Returns clamped angle in the range -180..180.

Parameters

Parameter

Description

MinAngleDegrees

"from" angle that defines the beginning of the range of valid angles (sweeping clockwise)

MaxAngleDegrees

"to" angle that defines the end of the range of valid angles

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss