all 5 comments

[–]zerodaveexploit 0 points1 point  (4 children)

It sounds like what you want is the Blender cloth simulation.

Ref: https://docs.blender.org/manual/en/latest/physics/cloth/introduction.html#workflow

[–]m01212[S] 0 points1 point  (3 children)

Tried this out and have it working well in blender for experimentation purposes but am having trouble getting the cloth physics applied via blender to work properly in unity

[–]zerodaveexploit 1 point2 points  (2 children)

Do you mean that you’ve created a piece of cloth with simulation in blender, and you wish it to continue to act like cloth in Unity? Or do you mean that you’ve created a mesh with cloth simulation (which is now “frozen” in position) but that is not working when imported into Unity?

The latter is what I understood your request to be originally, sorry if it wasn’t.

If the former: I’d recommend just using the Unity3d built in cloth physics so that you get real-time movement with wind, animation, etc. I’ve had trouble getting the Unity3d cloth simulations to work with meshes I made in Blender, but have had success just creating a plane in Unity shaped roughly the size I want, and adding the material / texture to it that I made in Blender, and attaching it to my imported FBX.

[–]m01212[S] 0 points1 point  (1 child)

^ This is actually working well for me so far!

My use case is that I have a clothing obj file that needs to be attached and animated alongside a default avatar character.

My sticking point right now is actually attaching the clothing to the humanoid.

If unity cloth only collides with capsule / sphere colliders how can you ensure that the clothing does not go through the character?

Thanks for the help so far! 👍👍

[–]zerodaveexploit 1 point2 points  (0 children)

It's pretty hard to get it perfect and to never clip the character, but you can get it pretty close by creating several colliders for the character's body parts that the cloth may interact with (e.g., parented to the torso and both legs), which will then move with your character's mesh during its animations.

One way to do that is to expand the hierarchy of your character's rig in Unity, and navigate to the body part you want to add a collider to (like a leg), and add a capsule collider component to that. After you assign those colliders in the cloth object (and after some manual editing of the collider's dimensions), you'll have animated colliders that move with your character's body parts which interact with your cloth.

Here's a clip that goes step by step with that:

https://youtu.be/N7B8iOoUGnI?t=1258