Prefab Groups

v4.0

Prefab Groups are groups of Prefabs and Game Objects (objects already in the scene), which can be turned on or off together. Groups can have any number of objects, and can mix both types.

Group Name This unique value will also be used when scripting.

Type This groups the Prefab Groups into types so that one can be set as "Default", and if the toggle is one, only one of each type will be active at once.

That means that if you Deactivate(groupName) a Prefab Group, the one set as "Default" will immediately activate. Also, if you call Activate(groupName), any active Prefab Group of the same type will be deactivated automatically.

Def. (Default) Toggle this to designate this object as the "Default", so when none of this group is active, this group will automatically activate.

Activate / Deactivate Use these buttons to test the setup and see what the results are.

Objects (#) Click this to turn on/off the Objects view, where you can add and manage the Game Objects and Prefabs in the group.

Shapes This is shown the Blend Shapes Manager is also attached. Click this to turn on/off the Shapes view. This is where you can set "On Activate" and "On Deactivate" actions for blend shapes.

If you are setting this up with a character, do not forget to add the Wardrobe Prefab Manager component as well, which is required to handle the auto-rigging of the wardrobe, as well as blend shapes.

Objects view

Drag or search for Prefabs and Game Objects into the yellow field next to "Add Prefab or Child Object to Group", to add objects to the group. If the option is turned on, Prefabs will be instantiated into the scene as you do this.

In this example, there are three Prefab Groups of type Body. Some of the objects are in all of the groups, such as the Trousers, because there may be future groups that have different pants.

The "Curiass" group has a green background because it is currently active, and the "Base Wardrobe" group is has "Def." checked on, as it is the default Prefab Group for type Body.

Groups for modular wardrobe

A common use case for the Prefab and Object Manager is to make modular wardrobe with large sets of options easier to manage. In many games, players can equip specific armor, boots, helmets, or other items separately from each other.

In that scenario, each separate type of wardrobe can have it's own type, with multiple groups set up -- one for each "thing" the player can equip.

Here we can see multiple types, with each type having multiple Prefab Groups, which can be mixed and matched together, presumably when the player equips certain items, or selects specific character classes.

Shapes view

If you are using the Blend Shapes Manager, you can use this section to set shape values when a Prefab Group is activated and deactivated. By default, there are not options set.

If you see "No Blend Shapes Available", expand the "Setup & Options" section of the Blend Shapes Manager component, and click the "Load Blend Shape Data". Then, deselect and reselect the object you're managing, which will force the blend shapes to load in this Shapes view.

If shapes you expect to see aren't showing up, you may also try clicking the "Manually Update Group List & Blend Shapes" button on the Wardrobe Prefab Manager.

For each action type, the first drop down contains shapes related directly to the objects in the Prefab Group, while the second drop down contains all of the shapes associated with the parent object. In either case, select a shape and click "Add to List" to create an action that will be performed either "On Activate" or "On Deactivate".

Click "Revert Back" to have the shape revert back to the settings it had before the Prefab Group was activated. Notes: Drop down lists in both sections will update when you choose one, making it a bit easier to click "Revert Back" right after adding a shape to the "On Activate" list!

There are three options available, "Explicit", "Less than", and "Greater than".

Explicit Select this to set a specific shape value. Min/max values set in the Blend Shapes Manager will be ignored.

Less Than Set this value to be the maximum value you'd like the shape to have. I.e. the end result will be "Less than" this value. If the value is higher than this value when activated, the shape value will be reduced to this value.

Greater Than Set this value to be the minimum value you'd like the shape to have. I.e. the end result will be "Greater than" this value. If the value is lower than this value when activated, the shape value will be increased to this value.

Click the "Set" button to set the value and visualize the outcome.

In the example below, whenever the "Barbarian" Prefab Group (type "Body") is activated, the right Pauldron and the Arm Muscles will be modified. When the shape is deactivated, those values will return to the pre-activation value.

Last updated