Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

Unity5 - Cloth doesn't work with skinned

Discussion in 'Physics' started by Gameccino, Mar 31, 2015.

  1. Gameccino

    Gameccino

    Joined:
    Aug 1, 2012
    Posts:
    28
    Hi,

    as I said in the title I have a big issue with the new unity5's Cloth component.

    The cloth does not bound the bones (it is rigged with the same character hierarchy) and it does not bound the two sphere colliders I created. It collapses and fall down. I tried to play around with the options and values with no luck at all. See the attached image to see the structure and the active components.
    As you can see the constrains are setted and I tried to :set it at zero or 1 as weel, removed, readded, resized the colliders. Even with no gravity the cloth fly away.

    Could anyone help me or give the right direction?

    screen.png
     
  2. MKDev

    MKDev

    Joined:
    Feb 19, 2015
    Posts:
    6
    You need to add your sphere colliders to the 'Sphere Collider' section of the Cloth component. Only then will the cloth collide with the colliders (it sounds like you've created them, but not added them to the Cloth component).

    btw, in each slot of the 'Sphere Collider' section, you can enter one or two sphere colliders - if you add two, you will be creating a conical capsule collider instead. You may need to add lots of these colliders to make it behave in the way you want, as cloth will not collide with your characters skin, only the sphere colliders you add.

    I hope this helps.

    Michael Wildoer
    Lava Software P/L
     
  3. truebototics

    truebototics

    Joined:
    Jan 2, 2016
    Posts:
    22
    @MKDev , how do you get the capsule colliders to follow the legs and arms with the characters movement so the body parts don't pop out of the cloth?
     
  4. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,919
    Cloth in unity is meant to be part of the actual base character mesh. It uses this to "pin". Colliders are really for addressing problems with intersecting, or props etc.

    Just use a character with the clothing already modelled into the same mesh.

    It doesn't work like standalone cloth any more as in old unity.

    In our game, we have clothing modelled as part of the animated character (same mesh). We then paint the required deformation for those parts of the character. Cloth should not be treated as a separate object, it is intended mostly for the same skinned mesh, for optimisation purposes.
     
  5. truebototics

    truebototics

    Joined:
    Jan 2, 2016
    Posts:
    22
    @hippocoder - thanks for the post and advice.... I got things to work pretty well now with the cloth setting on a robe (mesh) of a rigged fuse character... The setting that made the big difference was the "Surface Penetration" setting in the cloth physics. I selected most of the vertices on the robe with the "Surface penetration" set to 0 after I selected the constraints. This basically seems to act as a built in collider setting and now the legs don't penetrate the cloth and the cloth flows smooth, reacting to the leg movement - so I don't need the Capsule or sphere colliders... It wasn't clear in the manual or anything - but it works...