Make one-of-many choices
When to use this
Section titled “When to use this”Use an exclusive group when only one of several choices may be on: one hairstyle, one jacket, one pose of the ears. Pressing a choice turns the one that was on off.
To build a whole outfit menu with its submenu and group in one window, see Your first outfit selector. This page joins toggles you already have.
This needs Advanced mode, the default.
-
In the Hierarchy, select the object that holds your AvatarDoc component.
-
Make one toggle per choice. The quickest way: in the Hierarchy, select every piece, then drag them onto the menu tree in the inspector. Hold Ctrl (Cmd on a Mac) while you click to select more than one.
You should now see one toggle per piece in the tree, each named after its piece.
-
In the tree, select the first toggle. In its panel, type a group name into Exclusive group, such as Outfits, and press Enter.
-
In the tree, select the next toggle. Press the arrow button at the right end of Exclusive group and pick Outfits from the list.
The list shows None, the groups of this component, and the groups of the other AvatarDoc components on the avatar, each with its component in brackets. Do the same for each toggle of the set.
In the picture, 1 is the Exclusive group field, 2 the arrow button with the list of groups, and 3 Default on.
-
Tick Default on on the one choice that should be on when the avatar loads. Leave it off on every choice to start with none of them on.
A group belongs to the AvatarDoc component its toggles are on, and joins the toggles of that component by name. A toggle of another component on the same avatar, such as a prefab's, joins the group when you pick it from the list, where it shows with its component in brackets. See Groups of several components.
Pressing the choice that is on turns it off, and then no choice is on.
All the toggles of a group share one parameter. It holds a number for the choice that is on and costs 8 synced bits, however many toggles the group has. Eight separate toggles cost 8 bits too, so a group saves memory once it holds more than eight toggles.
The group's choice is saved and synced, for every toggle in it. In each toggle's Advanced fold, the Saved and Synced switches give way to the note Group saved and synced. Blend time is not used in a group, so the choices switch at once.
Check it worked
Section titled “Check it worked”- In the panel of one choice, press On in the Scene preview row (Advanced mode). Then do the same on another choice. The Scene view never shows more than one choice of the group. Press Default on each to stop the preview.
- In Play mode with Gesture Manager, press the choices in the menu one after another, as in Your first toggle.
If it does not work
Section titled “If it does not work”- Two choices are on at the same time: their group names differ. Another spelling or a capital letter makes a different name. Pick the name from the arrow button's list instead of typing it.
- A warning says the group has more than one toggle set as default: AvatarDoc uses the first one. Turn off Default on on the others. See the message.
Related
Section titled “Related”- Exclusive groups describes the group's settings.
- Toggle clothing and accessories explains what each toggle shows and hides.
Docs for AvatarDoc 0.7.1