Version: 2022.1
GameObjects
Introduction to components

Transforms

Switch to Scripting

The Transform is used to store a GameObjectThe fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and more. A GameObject’s functionality is defined by the Components attached to it. More info
See in Glossary
’s position, rotation, scale and parenting state and is thus very important. A GameObject will always have a Transform component attached - it is not possible to remove a Transform or to create a GameObject without one.

The Transform Component

The Transform component determines the Position, Rotation, and Scale of each object in the sceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary
. Every GameObject has a Transform.

Properties

Property: Function:
Position Position of the Transform in X, Y, and Z coordinates.
Rotation Rotation of the Transform around the X, Y, and Z axes, measured in degrees.
Scale Scale of the Transform along X, Y, and Z axes. Value “1” is the original size (size at which the object was imported).
Select the link icon next to the values to toggle proportional scaling. Proportional scaling adjusts the scale values proportionately to each other. For example, if your GameObject’s x, y and z axis values are (1, 2, 4) and you double the x axis value to 2, the y and z axis values change to 4 and 8 respectively. When enabled, proportional scaling also applies to changes you make using the Scale tool in the Scene view.
If any scale value is zero, it is grayed out and does not automatically adjust when proportional scaling is enabled.
Note: You can assign a keyboard shortcut to enable or disable proportional scaling. See Shortcuts Manager.

The position, rotation and scale values of a Transform are measured relative to the Transform’s parent. If the Transform has no parent, the properties are measured in world space.

Editing Transforms

Transforms are manipulated in 3D space in the X, Y, and Z axes or in 2D space in just X and Y. In Unity, these axes are represented by the colors red, green, and blue respectively.

A transform showing the color-coding of the axes
A transform showing the color-coding of the axes

A Transform can be edited in the Scene ViewAn interactive view into the world you are creating. You use the Scene View to select and position scenery, characters, cameras, lights, and all other types of Game Object. More info
See in Glossary
or by changing its properties in the InspectorA Unity window that displays information about the currently selected GameObject, asset or project settings, allowing you to inspect and edit the values. More info
See in Glossary
. In the scene, you can modify Transforms using the Move, Rotate and Scale tools. These tools are located in the upper left-hand corner of the Unity Editor.

The View, Translate, Rotate, and Scale tools
The View, Translate, Rotate, and Scale tools

The tools can be used on any object in the scene. When you click on an object, you will see the tool gizmoA graphic overlay associated with a GameObject in a Scene, and displayed in the Scene View. Built-in scene tools such as the move tool are Gizmos, and you can create custom Gizmos using textures or scripting. Some Gizmos are only drawn when the GameObject is selected, while other Gizmos are drawn by the Editor regardless of which GameObjects are selected.