Custom Maps & Logic
  • Custom Map Tutorial
    • Custom Map Introduction
    • Your first map
    • Map Navigation
    • Object Selection
    • Object Positioning
    • Object Attributes
    • Shortcuts and Macros
    • Editor Settings
    • Built-in Components Common Errors
    • Map Performance
    • Custom Assets
      • Your first Asset Bundle
      • Asset Bundles in Map Editor
      • Asset Bundles in Game
      • Adding to Asset Bundles
      • Asset Bundle naming
  • Custom Logic Tutorial
    • Custom Logic Introduction
    • Your first script
    • Variables
    • Types
    • Variable Inspector
    • Expressions
    • Conditionals
    • Loops
    • Functions
    • Coroutines
    • Classes
    • Static Classes
    • Components
    • Extensions
    • Cutscenes
    • Static Objects
    • Networking
    • Commenting
  • Reference
    • Static Classes
      • Game
      • Network
      • Map
      • UI
      • Time
      • Convert
      • String
      • Input
      • Math
      • Random
      • Cutscene
      • Camera
      • RoomData
      • PersistentData
      • Json
      • Physics
    • Objects
      • Component
      • Object
      • Character
      • Human
      • Titan
      • Shifter
      • MapObject
      • Transform
      • Player
      • NetworkView
      • Color
      • Vector3
      • Quaternion
      • Dict
      • List
      • Range
      • LineCastHitResult
      • MapTargetable
      • Random
    • Callbacks
      • Main
      • Components
  • Examples
    • Gamemodes
      • Survive
      • Waves
      • Endless
      • Racing
      • Blade PVP
      • Thunderspear PVP
      • Titan Explode
      • Cranked
      • More Examples
    • Components
      • SupplyStation
      • Daylight
      • PointLight
      • Rigidbody
      • NavMeshObstacle
      • Cannon
      • Dummy
      • Wagon
      • Tag
      • KillRegion
      • DamageRegion
      • MovePingPong
      • RacingCheckpointRegion
      • RacingFinishRegion
      • TeleportRegion
      • Animal
      • SignalMover
      • SignalSender
      • More Examples
Powered by GitBook
On this page
  • Fields
  • Functions
  1. Reference
  2. Static Classes

Math

Math functions. Note that parameter types can be either int or float unless otherwise specified. Functions may return int or float depending on the parameter types given.

Fields

Field
Type
Readonly
Description

PI

float

true

Mathf.PI

Infinity

float

true

Mathf.Infinity

Rad2DegConstant

float

true

Mathf.Rad2Deg

Deg2RadConstant

float

true

Mathf.Deg2Rad

Functions

Function
Returns
Description

Clamp(value, min, max)

int/float

Clamps the value between min and max.

Max(a, b)

int/float

Maximum of a and b.

Min(a, b)

int/float

Minimum of a and b.

Pow(a, b)

float

a to the power of b.

Abs(a)

int/float

Absolute value of a.

Sqrt(a)

float

Square root of a.

Mod(a, b)

int

Modulo of a % b

Ceil(a)

int

Rounds to higher int.

Floor(a)

int

Rounds to lower int.

Round(a)

int

Rounds to nearest int.

Sin(a)

float

Sin of a, in degrees.

Cos(a)

float

Cosine of a.

Tan(a)

float

Tan of a.

Asin(a)

float

Arcsin of a, in degrees.

Acos(a)

float

Arccos of a.

Atan(a)

float

Arctan of a.

Atan2(a, b)

float

Atan2 of a and b.

Deg2Rad(a)

float

Converts a degrees to radians.

Rad2Deg(a)

float

Converts a radians to degrees.

Lerp(a, b, t)

float

Linearly interpolates between a and b by t where t is limited from 0 to 1.

LerpUnclamped(a, b, t)

float

Linearly interpolates between a and b by t with no limit to t.

Sign(a)

float

Returns a value of 1 when a is 0 or greater. Returns a value of -1 when a is negative.

PreviousInputNextRandom

Last updated 7 months ago