Mathf

The Mathf struct is Unity's math utility class. It wraps common math functions and provides Unity-specific constants. You'll reach for Mathf whenever you need to clamp values, compare floats, or do basic arithmetic operations that go beyond simple operators.

More in Game Math

  1. Vectors
  2. Quaternions & Rotations
  3. Interpolation
  4. Mathf
  5. Trigonometry
  6. Random
  7. Coordinate Systems

All 157 topics in the Learn Unity Roadmap