Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Programming with mathematics

Use Unity's mathematical APIs to apply trigonometric, logarithmic, and other functions in your application, move objects with vectors, and generate random values.
Read time 1 minuteLast updated 6 days ago

Unity exposes several public APIs that allow you to work with mathematical concepts in your code. These APIs are useful for manipulating vectors, matrices, and other mathematical constructs that are common in game development.

Topic

Description

Moving objects with vectorsPerform vector arithmetic with Unity's 2D, 3D, and 4D vector classes to manage the position and speed of objects and the distance between them.
Using common math functionsUse Unity's
Mathf
class to apply trigonometric, logarithmic, and other math functions commonly required in game development.
Using randomnessUse the
Random
class to generate various types of random values commonly required in game development.

Additional resources