Hi folks. I’ve been struggling a lot recently with ‘flowy’ clothing (skirts, coats, capes, etc.) and trying to keep it from clipping through the body mesh when moving. Figured it wouldn’t hurt to post here and make sure I’m not missing something fundamental and/or that I’m keeping my expectations realistic.
Pretty much all the clothing I’ve been working with is already rigged and weighted to its own armature (aside: wow there’s a lot of great free clothes on Booth), and in most cases, they come with a unity .prefab with physbones and colliders already set up (albeit sized for whichever avatar base the clothing was originally designed for).
My process is roughly:
- Pull the clothing/armature fbx into Blender with my avatar
- Use scaling and elastic deform to fit the clothing to the avatar body, adjusting the location of any clothing-specific bones along the way
- Move clothing-specific bones from the clothing armature to the avatar’s armature with the correct bone-parent relations
- Re-parent the clothing mesh to the avatar’s armature
- Either rename vertex groups or use something like robust weight transfer to make sure any ‘static’ parts of the clothing mesh stay put in relation to the avatar (usually hips/spine/chest)
- Export the modified clothing + armature, copy to Unity assets, drag the fbx into the avatar’s hierarchy, and attach it using VRCFury/ModularAvatar armature link
- Using the original prefab as a template, create the colliders and physbones attached to the appropriate transforms in the clothing’s armature, adjusting positions/sizes of the colliders to match the avatar’s body
- Build & Test several dozen times to adjust everything in hopes of preventing clipping and inevitably give up or call it ‘good enough’ and try not to let adhd get triggered when walking past a mirror in-game and seeing things clip into the body
I guess my biggest questions have to do with expectations. In a lot of cases, I can get the clothing behaving in a way that I’m reasonably satisfied with, at least when standing still or moving slowly, but if I run, jump, use a chair/station, or activate an animation (ie, goloco sitting poses), it almost seems like the colliders just cease to exist. For example, putting a long skirt on the avatar, regardless of the size/position of colliders on the upper and lower legs (and the collision radius on the physbones), it feels like it’s impossible to not have the knees clip through when running, or the thighs clip when jumping. Making the colliders too big results in the clothing being pushed away from the body mesh even at rest, and limiting the physbone movement with ‘polar’ or ‘hinge’ (and adjusting pitch/yaw so the bones never get any closer to the body mesh) doesn’t seem to have any effect.
- Is that the expected behavior and just something I have to live with? Are my own expectations unrealistic? Do actions like jumping or activating goloco animations disable/ignore colliders?
- Do I need to make absolutely certain in Blender that any vertices weighted to the clothing bones have zero weight overlap with ‘primary’ bones (hips/spine/legs/etc)?
- Do I need to make sure any colliders are directly attached to the avatar’s armature and not the linked armature?
- I prefer to put my physbones and colliders into their own GameObjects in the avatar hierarchy with the appropriate root transform set. Would it make any difference if I put them into the transforms within the armature hierarchy directly? It doesn’t seem like it but maybe?
- Do I need to look into using some form of VRC___Constraint on the armature/bones/meshes somewhere?
Also just for the sake of noting it, this is all just for PC versions of avatars. When I make Android/iOS versions I usually just get rid of any extra bones entirely and weight the clothes directly to the main armature since something like a skirt is almost guaranteed to blow past the physbone (and regular ‘bone’ count) performance limits.
tl;dr: Am I doing something fundamentally wrong or just expecting too much?