
Unity uses the Vector3 class throughout to represent all 3D vectors. The individual components of a 3D vector can be accessed through its x, y and z member variables.
You can also use the Vector3 constructor function to initialise all components at once.
Vector3 also defines some common values as constants.
Operations on single vectors are accessed the following way:
And operations using multiple vectors are done using Vector3 class functions:
(Note that you have to write Vector3. in front of the function name to tell Javascript where to find the function. This applies to all class functions.)
You can also use the common math operators to manipulate vectors:
See the documentation on the Vector3 class for the full list of operations and properties available.