Search Unity

Cloth over body in Unity3D v5

Discussion in 'Physics' started by mmilne, Apr 19, 2015.

  1. mmilne

    mmilne

    Joined:
    Sep 13, 2014
    Posts:
    59
    I'm using Unity3D version 5 and this is the first time I've been getting into physical cloth. From what I've read you used to be able to use any kind of mesh collider for cloth to bounce off, now it seems you can only use spheres and capsules. How would I set up a dress for a female character that is animated with walking legs? Would I be expected to create some fake leg colliders using a combination of spheres and capsules or is there an easier way?
     
  2. xDavidLeon

    xDavidLeon

    Joined:
    Jun 9, 2014
    Posts:
    123
    Yep. Create some capsule colliders and attach them to the leg bones so they follow the movement.
     
  3. mmilne

    mmilne

    Joined:
    Sep 13, 2014
    Posts:
    59
    ok, I've done that. The collisions are there but my dress ends up in pieces as soon as I start the walking animation. The dress itself is just one object. In the initial position the capsule colliders are not intersecting with the dress. I have "tether" and "gravity" on. I've edited constraints to make all vertices movable to 0.5 except for the row of vertices at the top of the dress around the waist which is set to 0, so it latches onto the waist. Is there a tutorial somewhere on Unity v5 clothing and how to get it working with animated characters?

    EDIT:
    The dress falling apart was my fault. When I exported from Marvelous Designer it exported the fabric then all the textures as patterns on top of the fabric. Even though it was exported as one object it would split apart at the seams during movement.
     
    Last edited: Apr 21, 2015
  4. mmilne

    mmilne

    Joined:
    Sep 13, 2014
    Posts:
    59
    I've attached a picture showing what I'm trying to achieve. It looks fine when static, but when animated it looks terrible. Its impossible to replicate the contours of the hips and buttocks using capsules and spheres. I always get body mesh coming through the cloth. If I increase the size of the colliders (bigger than the mesh) then it looks ridiculous since you see the obvious bulge of the capsule or sphere (even with mesh renderer off)
     
  5. mmilne

    mmilne

    Joined:
    Sep 13, 2014
    Posts:
    59
    I figured it out! I need to rig the dress to the same rigging as the character (in Daz3D I used the 'transfer utility'). This will make the dress move with the body. Then in Unity when I add cloth component to the dress I edit constraints, select the vertices just below the waist and allow them to move 0.5. This makes the part that hugs the waist stick to it while the female moves and the rest will flow. I only needed 4 capsule colliders for the legs and they don't need to be 100% accurate since the dress isn't "hugging" the legs.
     
    Arkade and hopeful like this.
  6. xDavidLeon

    xDavidLeon

    Joined:
    Jun 9, 2014
    Posts:
    123
    Congratz! Glad you sorted it out! :)
     
  7. mmilne

    mmilne

    Joined:
    Sep 13, 2014
    Posts:
    59
    I put a video up if you want to see the end result
     
    BrandyStarbrite likes this.
  8. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    Hey! That looks fantastic! And PLEASE tell me that's a Project Runway style game! (Guilty pleasure...)
     
    2dchaos likes this.
  9. mmilne

    mmilne

    Joined:
    Sep 13, 2014
    Posts:
    59
    Cheers mate :) Its not a game, but a virtual reality experience. I'm putting together a virtual fashion show for Melbourne Spring Fashion Week using real catwalk models (scanned in 3D) and dresses replicated in Marvelous Designer.
     
    chelnok and BrandyStarbrite like this.
  10. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    Feel free to share any tips on getting cloth working. I'm not seeing a ton of threads on this yet.
     
    Liight and BrandyStarbrite like this.
  11. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    @mmline Do you get to be the one scanning the models? :p

    I agree with @hopeful, though. If you felt like putting together a quick tutorial on the full process, I'd be extremely interested in giving it a look.

    Also, when is MSFW?
     
  12. BrandyStarbrite

    BrandyStarbrite

    Joined:
    Aug 4, 2013
    Posts:
    2,076
    Wooah!! :eek:
    Cool!! :D
     
  13. Liight

    Liight

    Joined:
    Jan 29, 2014
    Posts:
    2
    Seconded, A full process tutorial is drastically need. I'm new to all of this and can't quite figure it out, and I need it for a fighting game I'm making ;D
     
  14. BrandyStarbrite

    BrandyStarbrite

    Joined:
    Aug 4, 2013
    Posts:
    2,076
    Wooah!
    Cool!
    Nice work dude! :D
     
  15. Done4Good

    Done4Good

    Joined:
    Mar 27, 2015
    Posts:
    9
    hi! does anybody know how to eliminate or minimize the gelatin effect of unity 5's cloth component? like the one on my cape. it's bothering me coz sometimes, the cape gets stuck on some of the colliders attached to character's body.

     
  16. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    (@Done4Good - We can't see the video as it is marked "private.")
     
  17. Done4Good

    Done4Good

    Joined:
    Mar 27, 2015
    Posts:
    9
    lol sorry XD fixing it now
     
  18. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    Do you have any bones in that cape? If not, maybe that would help.
     
  19. Done4Good

    Done4Good

    Joined:
    Mar 27, 2015
    Posts:
    9
    I'll try adding a bone then XD thnx
     
  20. vertgreenheart

    vertgreenheart

    Joined:
    May 6, 2011
    Posts:
    61
    I had a problem on making cloth by using joint.

    I use colliders attached to its bone and add Character Joint and Rigidbody.

    It's ironic that I invented this method but I can't use it myself. Here's tutorial from my blog.

    Is there anyway to make cloth physics without passing through skins using joint ? I'm kinda stressed out because of this.

    EDIT : No I can't use Interactive Cloth or Skinned cloth renderer, cause my model skirt and body was joined / connected.

     
  21. JohnUseUnity

    JohnUseUnity

    Joined:
    Mar 4, 2015
    Posts:
    7
    hi mmilne@mmilne:
    I have a problem of cloth component in unity。I rig a skirt to the character model of unity

    demo by using maya.But when I add the cloth component to the skirt ,and I meet a mistake.
    upload_2015-11-4_21-49-0.png
    I think you have done a good job with it.May I refer to your work and learn sth form it?Hope you can send me your unity project file.thank you
     
  22. ngohieutn92

    ngohieutn92

    Joined:
    Oct 15, 2015
    Posts:
    1
    Can you pls make a tutorial how to make this ? :D