By configuring swingable parts in a VRM model, you can swing hairs, skirts or anything.
For detailed specification on VRM, refer to VRMSpringBone.
Open the Inspector pane. You will see a script called “VRM Spring Bone.”
“Root Bones” property is the place to specify the bones to swing.
Expand the Root Bones to see Size property. For this example, set 2 in the Size.
We must specify colliders to avoid the hairs from penetrating through the body.
For this example, we will set colliders on arms to avoid hairs from penetrating them.
From the Hierarchy, select “elbow_L” and in the Inspector click [Add Component].
In the Hierarchy, select the “secondary” again. In the Inspector, expand the “Collider Groups” and in the “Size”, type “2.” On “Element 0” and “Element 1,” set “elbow_L” and “elbow_R” respectively.
Click on the Play button at the top of the screen again, then click on the Scene tab.
Now, in the Inspector, let's try changing the value of “Hit Radius” under Collider.
In the steps before, we have set the colliders on the elbows, then on the Spring Bone setting, we set it to collide with the colliders on elbows.
By making the value of the Hit Radius larger, the size of the collision detection area gets larger. When the value reaches a certain point where the colliders start to collide with the hairs, you should see the hairs being pushed against the colliders.
Here we will briefly explain three parameters of the SpringBone that control the behavior of swingables.
Stiffness of the object. It specifies how hard the object tends to go back to its original position.
Specifies the strength of the gravity.
Specifies the direction of the gravity.
Specifies the resistance. Higher value makes the movement dull; lower value makes the movement light.