Search Unity

How to use Cloth?

Discussion in 'Physics' started by alfchee, Mar 11, 2015.

  1. alfchee

    alfchee

    Joined:
    Jun 14, 2012
    Posts:
    19
    Hi,

    I have a game in which I have a flag, but that was using InteractiveCloth. Now porting the game to Unity3D 5 nothing of that works because is deprecated. Where I can learn how to use the Cloth for Unity 5??
     
  2. cAyouMontreal

    cAyouMontreal

    Joined:
    Jun 30, 2011
    Posts:
    315
    Good question here, the documentation says "TODO" so I guess we have to wait for them to write the documentation... è_é
    I'm looking for help too, we need to create some clothing for our characters.
     
  3. alfchee

    alfchee

    Joined:
    Jun 14, 2012
    Posts:
    19
  4. cAyouMontreal

    cAyouMontreal

    Joined:
    Jun 30, 2011
    Posts:
    315
    Wow nice, still better than nothing.
    I figured out how to create a cloth by trying things randomly until it worked.
    You will need a skinned mesh to make the cloth works. If you want colliders you can set them as trigger, it will work too (and that's great because I CAN'T create non trigger capsule colliders on my characters).

    The darkest part is the "Edit constraints" button. Once you clicked on it a popup on the scene view will appear. The first thing is to select vertex on your skinned mesh. The thing I do is to select all vertex (Ctrl+A) and then I check "Max distance" option and set it to like 0.05. All the vertex will be green now. Max distance seems to be the distance in world units where a vertex can be to another one. 0.05 seems a good value for me. Now select only vertex you want to "stick" with your character (most of the time for a cape it's all the highest ones, on top of the cape). And then set the max distance to 0. And that's pretty much it !

    Note that the color is always scaled to the vertex that has the highest max distance on your cloth.

    I recommend you to set the Damping value on the Cloth component to something like 0.5, 0 will make your cape shaking in a weird way...
     
  5. alfchee

    alfchee

    Joined:
    Jun 14, 2012
    Posts:
    19
    Hey!! thanks a lot for your explanation about the cloth, with that I started to test some values and go it. What I wanted to do is a Flag, so these are the values I used

    Screen Shot 2015-03-18 at 4.12.43 PM.png