An interactive 3D visualizer. Drag the sliders, watch the arrow move, and see how X, Y, Z coordinates work in Unity.
See how vectors combine and transform.
How long the arrow is. Calculated with the Pythagorean theorem in 3D.
sqrt(x² + y² + z²)Magnitude: 3.74
Shrink any vector to length 1, keeping the same direction. Toggle "Normalize" above to see it.
vector / magnitudeMultiply each component by a number to make the vector longer or shorter. Use the Multiply slider above.
Vector3 * scalarUnity uses Vector3 for almost everything — here's how.
Where the object sits in the 3D world. (0, 0, 0) is the center of the scene.
// Move to a specific spot transform.position = new Vector3(3, 2, 1); // Move 5 units to the right transform.position += Vector3.right * 5;
Euler angles — how many degrees the object is rotated around each axis.
// Rotate to face a direction transform.eulerAngles = new Vector3(0, 90, 0); // Spin 45 degrees on Y axis transform.Rotate(0, 45, 0);
How big the object is. (1, 1, 1) is the default size. (2, 2, 2) is double.
// Double the size transform.localScale = new Vector3(2, 2, 2); // Stretch on the Y axis only transform.localScale = new Vector3(1, 3, 1);
Unity has built-in constants so you don't have to remember the numbers.
| Name | Value | Use Case | |
|---|---|---|---|
Vector3.zero |
(0, 0, 0) | Origin, reset position | |
Vector3.one |
(1, 1, 1) | Default scale | |
Vector3.up |
(0, 1, 0) | Jump, gravity direction | |
Vector3.down |
(0, -1, 0) | Falling, ground check | |
Vector3.right |
(1, 0, 0) | Move right | |
Vector3.left |
(-1, 0, 0) | Move left | |
Vector3.forward |
(0, 0, 1) | Move forward (into screen) | |
Vector3.back |
(0, 0, -1) | Move backward |
Follow our step-by-step Flappy Bird tutorial and put these concepts into practice.
Flappy Bird Tutorial