0 votes
by (8.2k points)
edited by

Facing problems in positioning  and  scaling a game object (like cubes, cylinders, planes, etc.)

Saw some documents saying that there is no concepts of length in Unity. All you can do to determine the dimensions of the gameobjects is to use Scale.

Then how could I set the overall relative dimensions between the gameobjects?

For example, the dimension of a 1:1:1 plane is obviously different from a 1:1:1 sphere! Then how could I know what's the relative ratios between the plane and the sphere?

1 Answer

0 votes
by (8.2k points)
edited by

You can view your game object from different views and positions and scale it accordingly from scale tool or from transform.

All GameObjects in unity have a Transform component, which determines its position, rotation and scale. Most 3D Objects also have a MeshFilter component, which contains reference to the Mesh object.

Position GameObjects.

To alter the Transform component of the GameObject
, use the mouse to manipulate any Gizmo
 axis, or type values directly into the number fields of the Transform component in the Inspector
.
  • W for Move
  • E for Rotate
  • R for Scale
  • T for RectTransform
  • Y for Transform

Move

At the center of the Move Gizmo, there are three small squares you can use to drag the GameObject within a single plane (meaning you can move two axes at once while the third keeps still).

If you hold shift while clicking and dragging in the center of the Move Gizmo, the center of the Gizmo changes to a flat square. The flat square indicates that you can move the GameObject around on a plane relative to the direction the Scene view
 Camera
 is facing.

Rotate

With the Rotate tool selected, change the GameObject’s rotation by clicking and dragging the axes of the wireframe sphere Gizmo that appears around it. As with the Move Gizmo, the last axis you changed will be colored yellow. Think of the red, green and blue circles as performing rotation around the red, green and blue axes that appear in the Move mode (red is the x-axis, green in the y-axis, and blue is the z-axis). Finally, use the outermost circle to rotate the GameObject around the Scene view z-axis. Think of this as rotating in screen space.

Scale

The Scale tool lets you rescale the GameObject evenly on all axes at once by clicking and dragging on the cube at the center of the Gizmo. You can also scale the axes individually, but you should take care if you do this when there are child GameObjects, because the effect can look quite strange.

RectTransform

The RectTransform is commonly used for positioning 2D elements such as Sprites
 or UI elements, but it can also be useful for manipulating 3D GameObjects. It combines moving, scaling and rotation into a single Gizmo:

  • Click and drag within the rectangular Gizmo to move the GameObject.
  • Click and drag any corner or edge of the rectangular Gizmo to scale the GameObject.
  • Drag an edge to scale the GameObject along one axis.
  • Drag a corner to scale the GameObject on two axes.
  • To rotate the GameObject, position your cursor just beyond a corner of the rectangle. The cursor changes to display a rotation icon. Click and drag from this area to rotate the GameObject.

Transform

The Transform tool combines the MoveRotate and Scale tools. Its Gizmo provides handles for movement and rotation. When the Tool Handle Rotation is set to Local (see below), the Transform tool also provides handles for scaling the selected GameObject.

TechXR runs courses in AR / VR / Metaverse / Game Development. Some of the popular Q&A in our courses are available here for easy discovery.

113 questions

117 answers

58 comments

105k users

...