Creating Prefabs
This guide will go over how to create a modular prefab for use with the ADK or other modular avatars. This guide is universal, minus the parts specifically geared towards the ADK. Creating a prefab for ANGELWARE avatars is similar to creating assets for any Modular Avatar. We will focus on using examples for this guide, if you prefer a technical overview, please check out the AW_Asset reference guide.
Creating a prefab for the ADK uses 3 primary components.
For modular avatar parts, you can view the official Modular Avatar documentation on how to use them further than I have described here.
Creating Toggles for Your Asset
Creating toggles for your asset is simple, and dont require you to touch any animators. All animations are generated at upload time. I will go over creating an asset as I would myself. We are creating a basic clothing item that requires armature merging and a dissolve toggle.
Exporting Your Asset
Before we begin please read the exporting assets article to learn how to properly export assets for a modular workflow.
Using the AW_AssetComponent to generate needed toggles and radials
The AW_AssetComponent is where we generate all toggles and radials for our asset, as well as for the ADK, allowing a user to toggle objects in the ADK, and have those changes reflect in-game. The asset component is split into multiple parts, and we will go over each of them to create a simple toggle for an asset.
Header section
This is where we can set the title and the asset id for our asset.
Asset Header
- this is the title of your asset in the ADK, if left blank, no category will be created for the toggles in the ADK.
Asset ID
- this is the ID of your asset, used to keep track of it’s state in the features menu. Please choose something unique, that does not start with AW_ or ANGELWARE_.
Toggle section
This is where we can add on/off toggles for our asset. All toggles are smoothed, direct blend tree toggles. Each toggle will have the same smoothing time, regardless of if it requires smoothing or not. This is the reason for the delay in certain toggles on the model.
Add a toggle by clicking the plus (+) symbol at the bottom of the list, remove a toggle by pressing the minus (-) symbol.
ADK Settings
Toggle Name
- this will be the name of the toggle in the ADK. I have named this toggle “Hoodie”
Show in ADK
- this determines whether or not the toggle will be present in the ADK. I want users to be able to manipulate this asset within the ADK, so I have enabled this here.
Saved User Value
- this is the current value of the user’s selection in the ADK. Currently in this example, the Hoodie is toggled off, and will present itself that way in-game.
Parameter Settings
Parameter Name
- this decides whether or not a parameter and animation will be created in our animator for this object. I want to create an in-game toggle for this object, so I have given the parameter the name “Stealth/Hoodie”.\
Exposed Parameter
- I have enabled the exposed parameter for this toggle so it will appear in my VRCExpressionsParameters. Without this, the toggle would be exclusive to the animator-only.
Sync Parameter
- this toggle is something I want other players to see, so I have synced it over VRChat’s network. This also means this toggle will take up one bit of parameter space.
Save Parameter
- I want the state of this toggle to be saved between instances and avatar swaps, so I have set this toggle to be saved.
Material Toggles
For this guide I will only touch on material toggles, as they are the most common. This will go over a basic UV Discard Dissolve using Poiyomi, but it works with any material property within Unity.
Game Object
- the game object that contains the material I want to toggle the value of.\
Material
- the material I want to toggle, this is only used for manipulating the material using the ADK.
Property
- this is the material property I want to manipulate with this toggle. I have chosen a UVTile Dissolve, this is how most all of the toggles on the avatar work.
To get this value open up your material editor and unlock the shader. Scroll down to the value you want to toggle and check the “Animated” option. Next copy the “Animated Property Name” to get the value for the property.
Paste this value into the property field to manipulate this property.
Min / Max Value
- this is the On / Off value for the toggle, with X being off and Y being on. In this instance I want the tile to be dissolved when I have the toggle off, so I have set the value to 1, with the toggle appearing when enabled, therefore setting the value to 0.
Other Toggle Types
For conciseness, if you would like to use any of the other toggle types and need help, check out the AW_Asset reference for more information.
Advanced Settings
I will cover these briefly here.
Discards
- this will discard one of the preset body discards, as you can see here I have discarded the elbows to completely prevent clipping when bending arms.
Disable Parameters
- this is where I would add any clothing parameters I would like to disable, similar to the parameter name, this will always be prefixed with Menu/
ADK Camera Settings
- this is the position and rotation of the camera within the ADK’s preview window when the toggle is hovered or selected.
Sliders
Sliders are very much the same as toggles, except that they take up 8 bits of parameter space, and create radials in the menu instead of toggles. These will also generate variable sliders within the ADK. Some non-applicable options are missing but the concept of setting up a slider is exactly the same as a toggle.
ADK Colors
ADK Colors are color swatches that can be used to manipulate colors of the asset within the ADK. These colors do not do anything in-game.
ADK Settings
Color Name
- the name for this color swatch, I have called mine just “Color” here.
Saved User Value
- this is the currently saved color value from the ADK. It can also be used to set a default value.
Material Properties
This section is very similar to the material toggles section above, minus the game object and min/max values. Please refer to that section above.
Advanced Settings
ADK Camera Settings
- similar to toggles, here we can set the position / rotation of the camera within the ADK’s preview window.
ADK Sizes
This is a more advanced feature, please refer to the ADK Sizes article for information on this.