Unity Basics
  • Welcome
  • Getting Started with Unity Software
  • Helpful Shortcuts
  • The Unity Software Interface
    • The Default Interface
    • The Windows (Tabs)
      • Hierarchy Window
      • Scene Window
      • Project Window
      • Inspector Window
      • Game Window
      • Console Window
    • Other Layouts
      • Create a Custom Layout
  • Create
    • Creating Game Objects
      • 3D Primitives
      • Creating Game Objects in the Editor
      • Spawning Objects
      • Unhiding/Hiding Objects During Gameplay
      • Parenting
    • Creating Assets
    • Creating Components and Scripts
      • Adding Components in the Inspector
      • Creating Custom Components and Scripts
    • Creating Prefabs
  • Select and Update
    • General Selection
    • Search and Focus
    • Updating Game Objects
      • Updating Game Objects in the Editor
      • Updating Prefabs
    • Updating Assets
    • Updating Components
      • Update Components in the Inspector
      • Accessing Components Through Scripts
  • Delete
    • Deleting Game Objects
      • Deleting and Disabling Objects in the Editor
      • Using the Destroy() Function
    • Deleting Components and Scripts
      • Disabling and Removing Components in the Editor
      • Disabling and Removing Components During Gameplay
  • Translate, Rotate, and Scale
    • Intro to Transforms
    • Handy Transform Shortcuts
    • Translate
      • Positioning Game Objects in the Editor
      • Updating Position Through Script Code
      • Using the Transform.Translate() Function
    • Rotate
      • Rotating Game Objects in the Editor
      • Updating Rotation Through Script Code
      • Using the Transform.Rotate() Function
    • Scale
      • Resizing/Scaling Objects in the Editor
      • Updating Scale Through Script Code
    • Controlling Speed
    • Common Issues with Transforms
  • Materials
    • Material Basics
      • Creating and Applying Materials
      • Accessing Materials Through Code
  • Physics
    • Physics Basics
    • Colliders and Triggers
      • Collider Component Overview
      • Accessing Colliders Through Scripts
      • Common Issues: Colliders and Triggers
    • Rigidbody Component
      • Rigidbody Component Overview
      • Accessing the Rigidbody Component Through Scripts
      • Common Issues: Rigidbody Components
    • Common Issues: Physics and Velocity
  • Interaction
    • Interaction Basics
    • Keyboard Controls
    • Mouse Controls
  • Coding Basics
    • Intro to Scripts
    • Variables
    • Conditionals (If / Then / Else)
    • Arrays
    • Loops
    • Functions
Powered by GitBook
On this page
  • Overview
  • Resetting the Angles
  • Rotate Objects in the Scene Tab
  • Rotation Objects in the Inspector

Was this helpful?

  1. Translate, Rotate, and Scale
  2. Rotate

Rotating Game Objects in the Editor

PreviousRotateNextUpdating Rotation Through Script Code

Last updated 4 years ago

Was this helpful?

Overview

Every game object within a scene listed in the window has a Transform component shown in the window:

Here, we see the rotation's x, y, and z coordinates (Euler angles). For rotation, think of a rod going along the axis and the object being spun on it. Generally, the x-axis is horizontal, so spinning it moves the object up and down as you are facing it, the y-axis is vertical, so spinning it moves the object left and right, and the z-axis is forward and back, so moving it moves the object clockwise and counter-clockwise.

Since you can change the view of your Scene window and move cameras with their own transform components, the best way to determine an axis is to move the object with the transform vectors and watch the numbers in the component OR change the numbers and watch the object in the Scene View.

Resetting the Angles

You'll notice when you add a new game object, it will often have Euler angles that aren't (0,0,0). Right-click on the Transform component or click the three dots on the right of the component in the Inspector window to get this menu:

Here, Reset resets all the coordinates to (0,0,0) (position and rotation) and 1 x 1 x 1 (scale) or you can click Reset Rotation for just the local rotation of the object in Euler angles.

This will only reset the object's local rotation/Euler angles relative to its parent object. To reset to the game's (or global) rotation of 0,0,0, move the object outside of any parent object in the Hierarchy window, reset the rotation, then put it back where it belongs. This also updates the local reset rotation to whatever new rotation the object has when placed back into the parent object.

Rotate Objects in the Scene Tab

Click the Rotate Tool at the top left of the editor.

A quick way to select this is to press the E key on your keyboard.

You can click and drag on the red, green, or blue vectors to spin/rotate the object around the x, y, or z axes respectively. As you do so, you'll notice the numbers changing in the rotation property in its Transform component.

Rotation Objects in the Inspector

Just like in all components with number properties, you can adjust numbers by clicking and dragging your cursor over the property name. You must first hover over the property name (X, Y, or Z) to make arrows appear around the cursor. Once your cursor moves out of frame, it will reenter on the other side. The numbers should increase and decrease and you should notice the object moving in the Scene View.

In the Transform component, you can also type in the exact angles you need. The object's rotation will match.

This will make rotate vectors appear on the selected object in the window:

Scene
Hierarchy
Inspector
Click and drag a circle to rotate the object along the axis.
Click and drag left and right over the axis label to update the value or type in coordinates.