Intro to 3D Game Development

0 of 193 lessons complete (0%)

Scripting Part 2: Making Code Respond to Players

Rotate the Chest Lid

You don’t have access to this lesson
Please register or sign in to access the course content.

To rotate the chest lid, we need to figure out which axis to rotate it on. These are also named X, Y, and Z, like position, but can be hard to guess. Rotating things using the widget – the circular arcs that appear when you click the chest, and using the Entity panel will work differently, so it is important to use the Local section of the Entity panel to make sure our test rotations match the ones we create in code.

  1. With the Chest-Top selected, open the Entity panel.
  2. In the Transform section, make sure Local is selected.
  3. In the Rotation Local subsection, drag the sliders left and right until you see the chest lid rotate open the way you want it to. 

Tip: Resetting Values

Whenever you change a transform value, you can set it back to what it was a before using Ctrl+Z (or Cmd+Z on a Mac).

You can also type values directly in to the text boxes in the Entity panel, which is the easiest way to set them all to 0 in the first place.