Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Cloth Questions/possible bugs?

Discussion in 'Physics' started by Foestar, Jul 26, 2019.

  1. Foestar

    Foestar

    Joined:
    Aug 12, 2013
    Posts:
    350
    Am I missing something is the cloth component super buggy? I don't use the cloth much, or rather at all in fact. So I may just be missing the obvious despite not finding anything other than the "2018 cloth doesn't work" through google posts.

    I'm trying to add cloth to my mesh and pin it so my character has a working physics based sack around his lower body. The mesh is one sided, but the material's shader makes it double so it's pretty much a plane at this point exported from 3DS Max. I then add my sack mesh to the cloth object, add its material, then go to edit the constraints only to find no black circle as videos show where my mouse is over it.

    Manually selecting and changing them doesn't work either as the options are grayed out under the cloth constraints inspector. It's almost like it's being masked or something. I even read one older post saying they fixed their issues by resetting their layout but that did nothing for me.

    Anywho, any ideas or knowledge on the subject are welcome.
     
  2. KarlKarl2000

    KarlKarl2000

    Joined:
    Jan 25, 2016
    Posts:
    606
    You're not alone.. I'm running into issues after updating to 2018.4.4 ... something bugged out.
     
  3. Foestar

    Foestar

    Joined:
    Aug 12, 2013
    Posts:
    350
    I did finally get it working, literally did nothing different and it started to go. The paint mode is still bugged out, but the manual selection process works fine for me now when I click max distance/surface penetration. They no long stay grayed out. Not really sure why they started working, maybe resetting everything worked, I know I tried that several times. But alas, I'm pretty sure it was a bug.
     
  4. KarlKarl2000

    KarlKarl2000

    Joined:
    Jan 25, 2016
    Posts:
    606
    I ended up copying the one cloth game object that was working and deleted the other broken ones.. cloth is buggy :(
     
    Foestar likes this.
  5. Foestar

    Foestar

    Joined:
    Aug 12, 2013
    Posts:
    350
    Yeah, I'm hoping they have some upcoming much needed updates to this feature to help it. Shouldn't have to do a custom work around just to get a built in feature to work.
     
    KarlKarl2000 likes this.
  6. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Yes we've also been having problems with cloth in 2018.4.x...Have had to write a bunch of scripts to get around most of them.
     
  7. danUnity

    danUnity

    Joined:
    Apr 28, 2015
    Posts:
    229
    I am using 2019.2.0f1 and the cloth system is still pretty buggy... It literally explodes my mesh when I add any constraints on the particles ... Also when editing the particles, they are too big when the mesh is at the proper size for physics and sometimes they disappear when editing. Basically nothing works...
     
  8. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Had a whole bunch of problems trying cloth out today. Figured it would've all been fixed since the last time I checked a year ago. Figured wrong.
     
    M_R_M, soleron and awesomedata like this.
  9. KarlKarl2000

    KarlKarl2000

    Joined:
    Jan 25, 2016
    Posts:
    606
    Hi @SeanParkinson , just wanted to include you in this thread regarding physics bugs too.

    Thanks for looking into it!
     
  10. SeanParkinson

    SeanParkinson

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    17
    Hi, the fix for the exploding mesh didn't make it for 2019.20f1, it has just landed recently.

    I've also added code to allow the constraint size visualisation to be varied. This has just landed recently too.
     
    Foestar, AndrewRH and KarlKarl2000 like this.
  11. KarlKarl2000

    KarlKarl2000

    Joined:
    Jan 25, 2016
    Posts:
    606

    @SeanParkinson Awesome! Thanks a lot for supporting these bug fixes! BTW Will there be any support for us 2018 users? :rolleyes:
     
  12. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Fabulous!
     
  13. KarlKarl2000

    KarlKarl2000

    Joined:
    Jan 25, 2016
    Posts:
    606
    Hi @SeanParkinson I put together a video of what's happening to me when I make a simple cloth. Is this the same kind of behavior other people are having?


    I'm on Unity 2018.4.6f1

    You can see that I tried to edit the bounding box, but was not able to and the bounding box gets offset the more I move the game object AWAY from 0,0,0 :oops:

    I also just noticed that the bounding box affects visibility.. You can see the offset bounding box directly affects the cloth objects visibility. Also the bounding box gets offset that much is .... I suspect has to do with the child inheriting the Root Bone's parent position, rather than the cloth objects local position? That's my best guess

    Here you'll see the cloth constraints are being offset in a strange way :eek:

    Thanks for the support!
     
    Last edited: Nov 15, 2019
  14. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,419
    UI still broken in 2019.3.0f6

    Apparently the "max distance visualization" and "manipulate backfaces" allowed the display of the cloth verts BUT I cannot paint the verts easily because the brush radius seems to be snapping weirdly to some invisible grid. I'm painting on a sub-object in a prefab and my brush cursor is just wacky and not moving to the correct place...

    Also, my character disappears when I bring him to the origin and it displays a bounding box and breaks my mouse panning using middle-mouse..

    PLEASE fix the Cloth UI -- This thing is so broken! D:
     
    Last edited: Feb 16, 2020
  15. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,419
    Alright -- I think I've narrowed down at least ONE of the bugs.


    Can confirm this still happens on 2019.3.0f6 using custom Blender mesh.

    Steps to repro:
    1. -- Import an .fbx with any number of submeshes (i.e. cape submesh)
    2. -- Drop model straight into the scene view (position its root GO at 0,0.0 -- anywhere else makes things go NUTS.
    3. -- Check all the bounding boxes are correct.
    4. -- Add a cloth component to any submesh (i.e. to the cape submesh) and witness bounding box bug-out for that particular newly-clothed submesh.
    5. -- Try to edit cloth constraints and see (usually HUGE) bounding box wreck the ability to paint the cloth, and if you're much farther away from the origin, watch the UI just go nuts
    @SeanParkinson -- Please look into this.

    EDIT: This issue has been around since 2016!!!
    https://answers.unity.com/questions/1149101/why-does-adding-cloth-component-to-skinned-meshren.html

    And I would have to agree with one guy's post that just because this checkbox "fixes" the broken giant bounding box / zoomed constraint painting issue, "Update When Offscreen" is NOT a fix. It's a workaround. And it's not even close to expected behavior.

    Does Unity even HAVE a QA department?? -- If so, do they even look at the builds??
     
    Last edited: Feb 16, 2020
  16. mcmount

    mcmount

    Joined:
    Nov 15, 2015
    Posts:
    83
    The cloth has been broken for a while, some versions it has been working, like 2017.3.1f1. One workaround is to disable the cloth object compression. Painting is nearly impossible, it's more like trial and error to get it to work. When you do, the cloth behaves like a balloon. I don't really understand the problem with so many versions. I'm at 2019.3.06f and STILL having these issues... and the culling & scene cam angle....really this bad for so long...?
     
  17. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    Cloth work for me on Unity 2019.3.1f1. You may have to redo all your cloth to get rid off the errors. That's what I was doing to have no more bugs.
     
  18. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    851
    Can also confirm that with latest 2019.3.1f1 it kind of works, but for sure not all bugs are fixed, e.g. using max penetration does not, the editor sometimes doesn't work, and I have still some huge force impacting some of my cloth meshes (those which have a skinned mesh controlled by bones).
     
    awesomedata likes this.
  19. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,419
    This problem is what is impacting me the worst. I'm not sure it's a "force" but rather a scaling issue. The cloth seems to fall and move around in a big spherical area around my character. Were you able to get it working at all with your character? -- Also, have you reported a bug for this? -- It's kicking my butt too, and I had no idea it was related to bones..

    Even with all that, the UI is still ridiculously broken.


    I tried this, but no dice. That weird force described above is causing my major headaches (even after managing to wrangle the UI into some semblance of order.)

    All my cloth verts swirling around my character like an unholy storm of locusts at the end of days is rather terrifying to say the least. I really wouldn't consider this "working" -- and neither should either of you. Cloth has been an issue since 2016 -- at least that's the first time I tried to use it and failed, finding it to be a broken mess -- even back then. At the time, I wrote it off as growing pains -- but now, we're in 2020 and Unity can't even get the damn UI working?? This is nuts to me. "Unity has new and better things to do with DOTS and all the other awesome and exciting features planned" is no longer an excuse for this level of half-assery and neglect.
     
  20. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    851
    So it's supposed to be fixed in 2019.3.1f1, in 2019.3.06f cloth was still completely broken, and I can confirm that it works better now, I still have issues with bones driving the mesh, but need to do more tests, before I try to reopen the bug https://issuetracker.unity3d.com/is...93.1688744634.1580502394-799769757.1544889688
    Don't even know how to reopen a bug, though.
    If you have completely destroyed cloth, you should definitely upgrade to lastest, which will help.
     
  21. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    851
    So it's supposed to be fixed in 2019.3.1f1, in 2019.3.06f cloth was still completely broken, and I can confirm that it works better now, I still have issues with bones driving the mesh, but need to do more tests, before I try to reopen the bug https://issuetracker.unity3d.com/is...93.1688744634.1580502394-799769757.1544889688
    Don't even know how to reopen a bug, though.
    If you get completely destroyed cloth as you describe, you should definitely upgrade to lastest, which will help.
     
  22. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,419
    I am on that version -- I upgraded for this exact reason -- and it's still just a mess of exploded verts whirling around my character. :(


    If you want to confirm an issue and need some quick models, grab a game character with a cape off the models resource website and put cloth on one of its submeshes. In my case, I have the cloth submesh parented 100% to the upper-chest bone in an FBX and I get all sorts of issues.

    I broke my UI appearance altogether by constraining all my verts just to see what it would do in play mode. Now I can't get the UI back at all. :mad:
     
  23. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    851
    Ah, you still need to switch off mesh optimization for the FBX. And you cannot use surface penetration, as it's till broken.
     
  24. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,419
    Not using either of those. Still nuts... D:

    To get back my UI, I was able to switch to the other mode and then back to constraint painting mode. The UI reappeared.
    GAH wtf!!
     
  25. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    568
    I feel sorry to have to use this garbage and wasted half my day trying to make this work. . Is there an alternative other than Havok?
     
  26. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,419
    ObiCloth is a pretty decent alternative, but it took me a whole week of experimentation to get a simple cape on a skinned character mesh. Despite this, I still haven't figured out the ins-and-outs of the physics side of it. It is definitely NOT for the faint of heart.

    Maybe you'll have better luck than me.

    Be wary though -- documentation is outdated on most subjects, workflow has entirely changed, the example scene led me way away from what I was trying to do with a simple cape in regards to what components to use and how to set them up (as well as the skinned model), and weight painting appears to be a tad buggy in 2019.3 -- but it is functional after you get past the enormous complexities and study it very carefully to understand the concepts. Sadly, it is the only alternative I could find to get anywhere near a basic Cloth authoring component in Unity. So far, the experience hasn't been fun, but it is at least functional. That's more than I can say for Unity's cloth component. :(
     
    soleron likes this.
  27. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    851
    I basically tried all alternatives; Magica Cloth works good, but simulation does not look very realistic. Obi Cloth looks better, but is pretty slow and hardest to setup. There is a plugin which is not on the asset store (due to a very high price) called deformer, which works pretty good.
    Unity cloth would for my liking be the best of the bunch, if it would work 100% (or at least 80%)....
     
    soleron and awesomedata like this.
  28. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    568
    Thanks for the suggestions. I think I will try some old school technique with bones and physics. (Something like the "Dynamic Bone" asset.) No other system seems to be decent enough to bother.
     
  29. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    851
    you CAN try to workaround most cloth issues, if you don't need perfect results, and use 2019.03 latest. But you need to write some code around, as cloth still explodes as soon as it touches colliders, and without colliders it won't work, because surface penetration is broken, and also you should not use too many colliders, as at some point they don't seem to work anymore. The bigger issue with this is IMO that we cannot be sure that more stuff breaks again with next update, as no one seems to take care about. If you don't need very realistic results, you can use Magica Cloth. Still much better than. baking own solution, I also tried this ;) Unless you can afford to spend some weeks on it.
     
  30. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    I don't see why buying an expensive asset is the solution. I mean, you choose a realtime engine, just to buy a ton of assets that try to do better physics than the actual engine? The game engine should handle the best cloth simulation, not an asset ...
    Sorry, but if I need assets for most of the core features, then something is wrong with the game engine ...
     
  31. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    Well ... from what I've seen, cloth in Unity has been mostly broken since maybe 2013, despite different roll-outs of cloth every few years.

    How you may benefit from a store asset for cloth is you've got a developer dedicated to making cloth work, and making it work efficiently. It's not uncommon for the asset store to have excellent solutions for game developers that Unity just isn't focused on producing or maintaining.

    Basically, Unity tends to focus on the big picture items, like developing DOTS and HDRP, leaving smaller issues like cloth for individual developers to resolve.
     
  32. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    I do not see how I benefit. I would pay twice, one paycheck goes to Unity, one to the asset creator. While I should pay only once for core engine doing it's job: Rendering and physics.
    And I would not call a physic component a "smaller" issue.
    People here always downtalk major issues of the engine, like Unity is not responsible for rendering and physics flaws.
    Again, if the engine does not the main part good enough and I have to go on a big shop tour, I doubt it's useful at all. Also that investments would lock me up deeply with that engine, with no opt out without a finance loss.

    While I honor the work of asset creators, I will not see how buying assets as system of patching Unity will encourage Unity developers more at all ...
    It's fine buying assets that are fancy add-ons, but again I'm speaking of core features.

    It was not every time broken because I remember back then, I used for one project the cloth physics and I had no distortions and grid painting cursor did show up. With Unity 2019 suddenly I had bugs with my cloth and did no longer see the cursor for painting the cloth collision. So actually one Unity developer must be responsible for that step back.
     
    Last edited: Apr 19, 2020
  33. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    I'm not here to apologize for Unity or to persuade you to use it. I'm just explaining how it would make sense to buy a cloth plugin from the store.

    The Unity community uses the store not just to share art, but to provide workarounds for issues with the engine. Often developers in the store will release new features a year or two before Unity, so it can provide a benefit in that way too. Like, we the store gave us access to PBR from at least three different developers for about 2 years before Unity released their version of PBR.
     
  34. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    If I would need PBR, I would choose an engine that has it. Buying an asset for it is just a waste of money, like a mention above why it is worse for core features.
    If you are a small company you should think twice which engine to choose and where to spend the money, the decision is basically a decision of success and ruin.
     
  35. kukurenaiz

    kukurenaiz

    Joined:
    Sep 12, 2017
    Posts:
    57
    After years of using unity mainly for 2d (a mistake actually, since unity had hardly any 2d features back then), I spent 2 weeks messing with the whole engine, mainly the 3d features, and the Cloth component is the worst component of them all, and it should be abolished. The cloth system is more 'in preview' than every other package 'in preview', considering it is partially abandoned.
    • It's not efficient in general: it's a pain to paint the whole mesh while dodging the vertexes in the opposite side (with the select tool at least, I wasn't able to use the other ones).
    • It's not robust: The Cloth component also suffers a lot because of problems during the import, actually 90% of the problems I've found while searching, were caused by the fact that the mesh was rotated due to the discrepancy in the Unity's coordinate system or the different unit sze, I don't doubt that the bugs with the Paint tools that I've faced were also caused by some import setting, the cloth component should be able to handle this, at least warn or provide a way to adjust the mesh (there's a script in blender that corrects everything automatically), it causes a lot of bugs that most people with no knowledge can't figure it out.
     
    Last edited: Nov 17, 2020
    awesomedata likes this.
  36. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,419
    And yet, @Unity claimed we would have "a better Cloth experience soon" in 2019.1 -- lol
     
  37. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
    This bug is still in Unity 2020.1.5