Exercise - Organize and lay out objects with collections
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:
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
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.
With the newly duplicated Parts child objects still selected, drag them onto the RoverParts object to make them child objects of that object:
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.
In Hierarchy, clean up the RoverParts child objects' names by replacing the appended (1) with _Part.
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.
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.
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