-
Notifications
You must be signed in to change notification settings - Fork 169
Cloth
Setting up cloth
First create a slot data asset that has cloth weights on it.
-
Create your source FBX like normal (as if you were just creating a regular slot from it), and then add it to a scene.
-
Add a cloth component to the created object.
-
Set the vertex weights for the cloth, following Unity guidelines.
-
Create the cloth slot with the Slot Builder. Setup the [Slot Builder] like normal. Drag the SkinnedMesh from the scene hierarchy to the box that says "Drag FBX GameObject or meshes here to generate all slots and overlays for the GameObject". Currently, the "Slot Mesh" field will not accept your scene placed mesh, but you can drag and drop it on the "Drag Meshes here" area. This will generate the slot in the location specified.
-
Create a new "UMAClothProperties" object. Adjust the cloth properties on the object as needed. (See the sample "UMAClothPropertiesExample" object):
- Create a new UMARendererAsset. Assign the "UMAClothProperties" you created to the "Cloth Properties" field on the asset, and set any specific renderer properties. Cloth objects have their own renderer, so be sure to set it up like you need to make it work like your default renderer:
- Assign the renderer to your cloth slot:
You will probably need to add colliders to your character so the cloth correctly collides (Maybe not in some cases?) if so, add the "Physics Standard Recipe" or "Physics HD Recipe" recipes to the "Additional utility recipes" area of your DynamicCharacterAvatar:
Don't forget to setup the physics layers - there's a helper object for that also called "CollisionMatrixFixer", but you will need to make sure this works with your project, and adjust the layers as needed.
The default physics layers for UMA are as follows:
static int _defaultRagdollLayer = 8;
static int _noCollisionLayer = 10;