Exercise - Organize and lay out objects with collections

Completed

The Mixed Reality Toolkit provides a set of tools and components to accelerate your Windows Mixed Reality app development. Object Bar is one such component. Here are the steps to use Object Bar to organize a set of game objects:

  1. In the Hierarchy window, right-click on the RoverExplorer object, and select Create Empty to add an empty object as a child of the RoverExplorer object. Name the object RoverParts, and configure the Transform component as follows:

    • Position: X = 0, Y = 0.06, Z = 0
    • Rotation: X = 0, Y = 90, Z = 0
    • Scale: X = 1, Y = 1, Z = 1

    Screenshot that shows the newly created RoverParts object selected and positioned.

  2. In Hierarchy, select all the child objects of the following: RoverExplorer > RoverAssembly > RoverModel > Parts. Right-click on them, and select Duplicate to create a copy of each of the parts.

    Screenshot that shows how to duplicate all the parts selected.

  3. With the newly duplicated Parts child objects still selected, drag them onto the RoverParts object to make them child objects of that object:

    Screenshot that shows the newly duplicated parts as children of the RoverParts object.

  4. To make it easier to work with your scene, in Hierarchy, select the eye icon next to the object to toggle the scene visibility for the RoverAssembly object off. This selection hides the object in the Scene window, without changing its in-game visibility.

    Screenshot that shows the RoverAssembly scene visibility off.

  5. In Hierarchy, clean up the RoverParts child objects' names by replacing the appended (1) with _Part.

    Screenshot that shows how to clean up the duplicated names.

  6. In Hierarchy, select the RoverParts object. Then, in the Inspector window, select Add Component, and search for and select ObjectBar. This selection adds the ObjectBar component to the RoverParts object.

    Screenshot that shows the RoverParts object with Add Component Object Bar in progress.

  7. Next set the number of Object Bar Objects to 5 and drag in each of the child parts. Notice that they are automatically clumped on top of each other.

    Screenshot that shows the RoverParts added as Object Bar Objects.

  8. Configure the ObjectBar component values as follows. The other fields can be left with their default values:

    • Object Bar Flow Direction: Horizontal
    • Spacing Between X: 0.25
    • Spacing Between Y: 0

    You can also set the Transform of RoverParts to view it at a different angle. For instance:

    • Rotation: Y = 0

    Screenshot that shows configuration of the Object Bar properties.