Skip to main content

Mathf

UnityEngine.Mathf · Official documentation

Scripts can use these 59 members of Mathf. Anything not listed here is a compile error when you build your world.

Properties and fields​

NameAccess
Deg2Radread only
Epsilonread only
Infinityread only
NegativeInfinityread only
PIread only
Rad2Degread only

Methods​

MethodParameters
Abs(int)
Abs(float)
Acos(float)
Approximately(float, float)
Asin(float)
Atan(float)
Atan2(float, float)
Ceil(float)
CeilToInt(float)
Clamp(int, int, int)
Clamp(float, float, float)
Clamp01(float)
ClosestPowerOfTwo(int)
CorrelatedColorTemperatureToRGB(float)
Cos(float)
DeltaAngle(float, float)
Exp(float)
Floor(float)
FloorToInt(float)
Gamma(float, float, float)
GammaToLinearSpace(float)
InverseLerp(float, float, float)
IsPowerOfTwo(int)
Lerp(float, float, float)
LerpAngle(float, float, float)
LerpUnclamped(float, float, float)
LinearToGammaSpace(float)
Log(float)
Log(float, float)
Log10(float)
Max(int[])
Max(float[])
Max(int, int)
Max(float, float)
Min(int[])
Min(float[])
Min(int, int)
Min(float, float)
MoveTowards(float, float, float)
MoveTowardsAngle(float, float, float)
NextPowerOfTwo(int)
PerlinNoise(float, float)
PerlinNoise1D(float)
PingPong(float, float)
Pow(float, float)
Repeat(float, float)
Round(float)
RoundToInt(float)
Sign(float)
Sin(float)
SmoothStep(float, float, float)
Sqrt(float)
Tan(float)