Skip to main content

How do you do maths with a Transform?

For doing maths with transforms there are three primarily interesting things stored in a transform that we can manipulate: Position, Rotation and Scale.

The position is basically just a 3-dimensional vector we can manipulate. Therefore we can use it to do vector maths!
In the inspector, the position is always displayed in "local-space", so be aware of that when looking at your transforms in the inspector.


Rotations are less interesting for doing vector maths specifically, but generally the same principles used for the vector manipulations can be applied to rotations.

Scale seems to be interesting at first as it can be used to scale i.e. multiply the position of a child. However there is a much better way to achieve the same thing.