Search Unity

Major cloth issues in v2019.2.0f1

Discussion in 'Physics' started by Neale_GH, Aug 19, 2019.

  1. Neale_GH

    Neale_GH

    Joined:
    Sep 5, 2018
    Posts:
    2
    We have just updated our Unity project to version 2019.2.0f1.

    We have 2 big issues with the update to the cloth physics component, which we use on virtually all of our characters.

    The first is that all of the painted weights on the cloth component are all over the place (as seen in Cloth_01.JPG). Before the updated the weights were painted in neat rows gradually increasing in distance, but now they look like this.

    The second, and bigger, issue is that the new cloth physics only seems to work if the vertices of the mesh are skinned to a single bone (Cloth_02.JPG). Setting the distance to 0 results in the mesh following the skinning, as expected, but for some reason when the cloth is skinned to more than 1 bone the vertex positions go crazy, and get progressively more erratic with increasing distance.

    My understanding of nvCloth was that the mesh should still obey the skinning and use a mask (i.e. the distance) to determine the amount of influence the physics has over each vertex.

    Has anyone else experienced this, and if so, do you know of any solutions beyond re-skinning, re-importing, and re-weighting all of our characters?

    Many thanks in advance.
     

    Attached Files:

  2. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,608
    Yeah there are a bunch of cloth issues in 2019.2.0f1

    I think your first one is the same as mine:

    Issue - Corrupt mesh after importing .unitypackage into Unity 2019.2.0

    Status:
    • Reproduced in Unity 2019.2.0 on Windows
    • Bug not present in Unity 2019.1.8 & 2019.1.14, so seems like a regression
    • Awaiting feedback from Unity to confirm the issue and timeline for a fix
    Links
    If you import the .unitypackage file into Unity 2019.2.0 then the cloth mesh becomes corrupt. I exported this .unitypackage from Unity 2018.4.4 on Windows.



    Seems to be cloth related because if I disable the Cloth component, the distortion disappears.
     
  3. Neale_GH

    Neale_GH

    Joined:
    Sep 5, 2018
    Posts:
    2
    Thanks, Andrew. Yeah, that def looks the same issue as the first one- I'll keep track of that one as well.
     
  4. 2dchaos

    2dchaos

    Joined:
    Sep 11, 2013
    Posts:
    63
  5. TacticalShader

    TacticalShader

    Joined:
    Dec 5, 2018
    Posts:
    6
    FYI This bug is also present in 2019.2.5f1. All of our skinned mesh renderers with clothes are no longer functionning properly. Hi @SeanParkinson, do you know anything about this ? Any workaround per chance ?
     
  6. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,608
    Tried 2019.2.6?
     
  7. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,608
    For the first issue, I think it would be possible to write some sort of script to solve it as a workaround. The script would export the weight values in Unity 2018 and then apply them based on space location in 2019 to fix the weights.

    The second issue with bones sounds like it would require an internal fix...Unless somehow fixing the above weights also fixes this :) If I get some time maybe I'll write this script as it would be useful until the bug gets fixed.
     
  8. TacticalShader

    TacticalShader

    Joined:
    Dec 5, 2018
    Posts:
    6
    Yeah still present on Unity2019.2.6f1.

    Even after re-editing the constraints, I still have vertices all over the place.

    I've attached some images of what's happening on my side.

    Cloth component disabled :
    No Cloth.png

    Cloth component enabled :
    With Cloth.png

    Edit constraints mode active (all constraints set to max distance = 0)
    Cloth constrains.png

    Cloth component parameters :
    upload_2019-9-20_10-49-28.png
     
  9. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,608
    Thanks, that really shows the issue well...

    It would be interesting to save the same scene with zero maxdistance weights in both 2018 and 2019.2 and do a diff to see if it's something in the scene that's causing the issue, or rather something inside Unity engine.
     
  10. SomeGuy22

    SomeGuy22

    Joined:
    Jun 3, 2011
    Posts:
    507
    Okay I think I can quantify what's going on a little bit. This is a series of frankly serious issues that has persisted for at least the past several months of Unity updates. I think there's some confusion in this thread because we're all seeing slightly different artifacts, and I believe it's coming from 3 separate bugs which may have to be dealt with individually.

    1. Updating cloth to 2019

    I haven't tested this but from your first screenshot it looks like the weights got juggled around a bit upon update. You already pointed this out but I think it's unrelated to the other issues.

    2. Cloth stretches/distorts in the Editor

    This is a weird one. I've tried tons of different combinations of modifiers/UV unwrapping in Blender to reproduce, and I have narrowed down the cause a little. It seems to be related to either mesh density or total vertex count. Take a look at this cube which is rigged to a single bone:



    I had trouble reproducing it on a non-rigged object so I just weighted this cube to one bone. This allowed it to automatically enter as a Skinned mesh, as opposed to the Cloth generating one from a mesh filter/renderer. I'm using the solidify modifier to reproduce the cases that broke in my game. Now look what happens if I use a subdivision surface (a modifier that subdivides all polygons):



    No cloth settings have changed, yet the stretching is now happening. So is something wrong with the subdivide modifier in Blender? I think so. This is the result I get when doing a "manual" subdivide smooth under the special menu:



    It should be no surprise now that this is the result when I remove the Solidify modifier and manually extrude the rest, while leaving the subdivide modifier enabled:



    This proves that it's clearly not some combination of solidify/subdivision, but rather just an artifact of the subdivision. Now the most interesting part is when I apply the subdivision modifier:





    The issue persists.

    So what have we learned? The subdivision modifier does... something weird to the mesh. I was able to get distortion without the subdivision modifier by performing arbitrary steps of duplication and rotation, but sometimes it just won't reproduce.

    3. Cloth disappears during Play Mode

    My best guess is that this happens when a "bugged" Cloth from Bug #2 is run with constraints active. This is what happens when Playmode is activated without constraints:



    This is a capture from the first frame of playmode. After playing it falls down as you'd expect, no distortion. However, this is what happens when I add constraints to the top of the mesh vertices.



    We get this buggy mess. Those black shapes are part of the cube. All I did differently is add a constraint of distance 0 to the top of the mesh, and you'd expect it to just stay in place. In fact, when tested on a non-bugged cube, that's exactly what happens. So practically it makes sense to avoid the stretched/distortion bugged state that these objects get into.

    Final Thoughts

    It's a bit complicated to explain all this over a Unity bug report, and I'm not sure if the cloth disappearing bug could be fixed thus fixing the rest of these... I'll have to do more testing and see if I can get my mesh working by playing around with the subdivision and UVs. I'm not sure if other parameters such as skinned mesh vs. static will affect it, I really can't afford to waste more time on this. I don't know what else to do except bring it to Unity's attention. I've voted on the issue tracker you listed so here's hoping they investigate further and nail down the cause. I might report back if I can come up with a workaround for my cloth meshes.
     
    Last edited: Sep 21, 2019
    AndrewRH likes this.
  11. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,608
    Very nice report. there appear to be some screenshots missing, and perhaps one that was an duplication of a previous one.

    Cheers,
     
  12. SomeGuy22

    SomeGuy22

    Joined:
    Jun 3, 2011
    Posts:
    507
    Yes thanks for that, I corrected it. I'm not sure about the duplicate because the the results are just really similar in my examples, regardless the point is that you get the same stretching from the different methods I applied.
     
  13. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,608
    I'm surprised that these cloth issues weren't picked up by all the automated testing the Unity has for regressions. Anyway, hopefully they'll be adding some more cloth tests to make sure this sort of thing doesn't happen in the future.
     
  14. Quang_Phan

    Quang_Phan

    Joined:
    Dec 28, 2016
    Posts:
    2
    I meet same problem
    Here is Unity 2018:


    And here 2019:


    Anyone have this problem like and know how to fix it or must re-add cloth again?
     
  15. unity_n2FvEnfvq2vehA

    unity_n2FvEnfvq2vehA

    Joined:
    Jan 27, 2019
    Posts:
    16
    I have same problems in 2019.3.0b4, sinse 2019.2 in all versions cloth seems to be broken :(
     
    2dchaos likes this.
  16. petersx

    petersx

    Joined:
    Mar 5, 2015
    Posts:
    217
    last good and stable cloth component was in 5.5 - maybe will be fixed in 2025 ? 2026 ?
     
  17. unity_n2FvEnfvq2vehA

    unity_n2FvEnfvq2vehA

    Joined:
    Jan 27, 2019
    Posts:
    16
    I somehow also gave up hope and instead am waiting for a new version of Obi cloth; which unfortunately also never worked for me so far, but the engineer(s) aiming to release a version which should work with 2019.2 + somewhere in October.
     
  18. SomeGuy22

    SomeGuy22

    Joined:
    Jun 3, 2011
    Posts:
    507
    In order for them to fix it, it would need to be added as a bug report and put on priority. As stated there are likely multiple separate bugs, and I'm not sure which are related to which. It's possible if they investigate the issue listed at the top of this thread that it would lead to the solution for everything else, but I'm not sure it's really on their radar yet.

    I might have enough info to submit a good report, but again I've already wasted so much time testing and getting set back by cloth issues that I'm not sure if it's worth it to do a write-up yet. I would want it to be as detailed as possible so that everything gets fixed, but I'm still confused about the root cause of Bug #2 in my last reply. I would like to get more info on how the models are set up so I can confirm my findings. And there are likely more cases which can cause the same bug, so it'd be helpful to document those as well. I'm trying to be thorough because this is a major feature for Unity and we haven't had fully stable cloth for at least several months now.

    @TacticalShader your stretching looks similar to my Bug #2, can you share some details about the model you're using? Was it made in Blender, and if so, does it have a subdivision modifier? Can you share the model so I can test it out as well?

    @AndrewRH I believe I tried your jacket model in a different thread but I'd like to take another look. What program are you using to make it? Are you using subdivision? Can you share your model which is encountering stretching/distortion?

    If I can find similarities between our models maybe I can track down more causes or confirm what I observed last time. If I can reproduce the stretching consistently I'll see about writing a new bug report, because it would show for sure that it's different than the one listed at the top. The problem is it seems like it doesn't always happen, so it could be that once a model gets "bugged" it starts behaving differently than how a non-bugged one would react. Perhaps a non-bugged model would have no problem with subdivision, or maybe a bugged one has different reasons for going invisible on playmode than a working model? We just don't know enough yet. If everyone could contribute screenshots and upload models of your bugs we can hopefully narrow this down, which makes fixing it much easier for Unity team.
     
  19. unity_n2FvEnfvq2vehA

    unity_n2FvEnfvq2vehA

    Joined:
    Jan 27, 2019
    Posts:
    16
    What I don't understand is that there were already support tickets, which were closed with "fixed" in 2019.2 and 2019.3, but at least in my experience the cloth component is still completely broken in latest releases. And it does not need much to replicate, just apply cloth and see it's completely broken. Here is the ticket I am referring to.
     
  20. coryheald

    coryheald

    Joined:
    Oct 28, 2013
    Posts:
    27
    So this weekend I spent a good deal of time working with cloth in 2019.2.6f1. At the beginning, I switching to the newer version did nothing. I decided to start from scratch and use "the scientific method" of change 1 thing and see. In the end, I have my cape working for my character. I have attached as many settings as I can in hopes something I did will work for some of you.

    Couple things I learned:
    • never play the game while inside the prefab
    • only use your main screen - work on second monitor causes issues
    • dont re-use your old cloth, start from scratch.
    Here are some image of how my character is setup and the settings I have currently

    Cape cloth with bone capsule collides
    upload_2019-9-30_9-6-9.png

    Settings for my cloth

    upload_2019-9-30_9-6-52.png

    Surface penetration .1-.2 range

    upload_2019-9-30_9-7-53.png

    Max distance .1 to 1

    upload_2019-9-30_9-8-37.png
     
  21. unity_n2FvEnfvq2vehA

    unity_n2FvEnfvq2vehA

    Joined:
    Jan 27, 2019
    Posts:
    16
    I tried the exact same settings; in 2019.3.0b4 I get same bad behavior that I get in all my tests: performance is like slide show (less than 1 frame per second); cloth gets destroyed, with your settings not that much than usual.
    Maybe it is related to HDRP, which I am using since 2019.2, where the issues started.
     
  22. 2dchaos

    2dchaos

    Joined:
    Sep 11, 2013
    Posts:
    63
    The bug is still present, there are no estimation of when it's going to be fixed and it's a pretty essential part of the physics system.
    It's making it difficult to justify updating from 2019.1, even with the new bells and whistles that 2019.3 is bringing to the table.
     
  23. coryheald

    coryheald

    Joined:
    Oct 28, 2013
    Posts:
    27
    Interesting. I am not using HDRP - but I am getting great frame rates. I started with just making a cap on a box which actually looked really nice. However, what was really odd to me is that when i applied the same settings to a cape on a character - everything went crazy again. I ended up completely changing the settings for the character cape.
     
  24. SomeGuy22

    SomeGuy22

    Joined:
    Jun 3, 2011
    Posts:
    507
    I'm well aware of that issue and when it first came up I spread the link to every related thread I could find; and that bug is indeed fixed. If you get the latest version of Unity and apply a cloth to a plane after rotating it, you'll find that cloth gravity works in the correct direction now. That is only bug which was listed in the ticket and the *only* one which they promised would be fixed in 2019.3. Cloth is not "completely" broken, as it still works for me if I put it on default primitives. From my last experiments I was only able to achieve bugged cloth under certain conditions in Blender such as using the subdivision modifier on a rigged model.

    I'm with you that they should do further checks into cloth and try to fix more of these bugs, but the ticket you listed did NOT address those bugs, only the specific gravity one. Now I'm proposing that we compile our examples of the 3 bugs I listed above and submit a new ticket, because that's the only way for it to really get on their radar and get them fixed. Just telling them to "fix cloth" honestly will not help any dev that looks at the issues. What will help is narrowing down the exact conditions in which the bugs can be reproduced and submitting a report for each one individually. I will try to do more tests this week and get a solid report going.
     
  25. unity_n2FvEnfvq2vehA

    unity_n2FvEnfvq2vehA

    Joined:
    Jan 27, 2019
    Posts:
    16
    uh, yes, you are right. build a very simple test project, and found out that it seems to depend a lot on the mesh. I could apply cloth on s simple quad, and also on some mesh with around 1K vertices, while on second I get same issues as described here in the thread, but still it somehow works at least.
    Using meshes with more vertices lead to huge issues, but will do more testing. Meshes which worked with 2019.1 are definitely completely broken in 2019.2 + , leading to fps of 0.5 -3 and distortion of the mesh beyond being recognizable anymore.
    Will update if I find a "threshold" or any other factor which makes a mesh unusable.

    Edit: After some more testing, I don't find a pattern. Out of 5 more complex meshes, only one worked, all other show behavior I described above. the one wich worked had 1.5K vertices; however, I tried different other ones, mixed SkinnedMeshRenderer and MeshRenderer based ones, with vertice count from 1K to 11K, none worked. The one which worked was based on SkinnedMeshRenderer. But in general, it does not seem to work on most meshes I tried, always applied the same settings.

    Edit2: some more testing with 10 more meshes; on none it worked. was a mix of rigged and non rigged meshes, so I don't think this has impact. on one mesh I got an interesting behavior: on the first constraint setting, I still got distorted cloth, but high frame rates. I wanted to fix the distortion by changing the constraints, but then it was still distorted, and frame rates dropped again to one digit. Maybe it's not the vertex count, but the way constraints are organized which leads to the issues. this is hard to test, but anyway, it worked on 1 out of 15 times, so I would still consider the cloth component completely broken for real world use cases, and it is incredibly easy to reproduce.
     
    Last edited: Oct 2, 2019
  26. GameDevCouple_I

    GameDevCouple_I

    Joined:
    Oct 5, 2013
    Posts:
    1,974
    Can anyone having issues with cloth in this thread still, please file a bug report following these guidelines: https://unity3d.com/unity/qa/bug-reporting

    Without bug reports, there is not much the team can do. If multiple users are having issues with this, your first port of call should be to file a bug report and then post back here with the case ID.

    Unity developers do come on these forums but there is no guarantee they will read or act on anything posted here. If you post a bug report, they will act on it as they are mandated to - and it provides them with the data necessary to do this. Whenever decent data is provided via forums they also act on it, but you cant beat the usefulness of diagnostic info sent via a bug report.
     
  27. unity_n2FvEnfvq2vehA

    unity_n2FvEnfvq2vehA

    Joined:
    Jan 27, 2019
    Posts:
    16
    for me it seems that this report seems to be the main thing. Not sure what else to describe, as the behavior is too erratic. But as soon as anyone is trying the project in the report it should show that there is something very wrong. I can imagine that the performance problem is related to this, as calculation of a wildly flying around mesh is probably hard for the physics system.

    Edit: So maybe it would help if everyone votes on that issue ;) ?
     
  28. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,608
  29. GameDevCouple_I

    GameDevCouple_I

    Joined:
    Oct 5, 2013
    Posts:
    1,974
    Fantastic, thats great! Now lets hope the issue gets dealt with!
     
  30. BakoGames

    BakoGames

    Joined:
    Aug 28, 2017
    Posts:
    2
    Last edited: Oct 5, 2019
  31. chaneya

    chaneya

    Joined:
    Jan 12, 2010
    Posts:
    402
    I found 2 issues that made a big difference for me. When I upgraded to 2019.2.9, my cloth objects completely broke....basically exploded or wrapped into little tin foil balls when I hit play.

    1. During one of the last Unity updates, they added Optimize Mesh to the FBX. Model importer. It was defaulted to Everything, Polygon Order, Vertex Order being checked. When I changed it to nothing, my cloth stopped exploding. So on your cloth models make sure you have Nothing selected on the Optimize Mesh setting in the Model Importer.

    2. Of course I had to repaint all of my weights. It's a pain but I expected this since this has broken on several previous Unity updates. What I didn't expect is if you have the cloth gameobject selected and showing in the inspector when you hit play, you will lose all vertex paint circles (points) and of course the cloth is broken (ie. you lose all contraints Max Penetration and Surface Penetration weights you just spent time painting) When you stop play and look at your cloth and go into Edit Constraints mode, you will see there is only one circle thingy at the origin of your cloth. Here is the fix: Select the cloth in your Hierarchy, hit delete to delete the cloth gameobject and then Ctrl Z to reverse the delete you just did. All of the vertex paint point/circle things are now back. Yeah I know it makes no sense. From now on, do not have the cloth gameobject selected when you hit play. Just remember to select something else.

    Lesson learned: Unity doesn't beta test this stuff. You are the beta tester.
     
    VLukianenko likes this.
  32. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    111
    I've had same issue, replied a e few days ago to someone else's thread. With FBX I found the same "fix" as @chaneya, I disabled all import optimizations. After that I tried out many different meshes from Blender and so far no vertices going to weird directions or getting pinned to other vertices when cloth is simulated.
     
    2dchaos likes this.
  33. SomeGuy22

    SomeGuy22

    Joined:
    Jun 3, 2011
    Posts:
    507
    I just tried to submit a bug report with some of my findings here but I never got an email back... it might've glitched out.

    !!!! That was it! When I disabled Optimize Mesh for my character I got no distortion or disappearing in playmode! I'll have to check it against my other test cases but it looks like that will work as a fix for now. You've just saved my project, I can't thank you enough!! :)

    EDIT: Disabling optimization definitely helped get rid of distortion in playmode, but I'm still experiencing odd behavior for some of my more complex meshes. I'm getting a lot of puffing and random motion when tested against a character's cape, even with default settings and no collision. I'm also getting the edges between constrained vertices and free ones getting stretched, and glitchy behavior where they meet. Looks like constraints are what's the causing the issue, because I tried adding a few to a default cube and it just inverted itself/stood in place in playmode.



    And indeed, when I do testing on a default plane things look fine when there are no constraints. When I constrain one edge to be distance 0, the other half of it flies wildly on playmode, as though some force is moving it. Gravity is correct as it will always tilt downwards after a while, but it appears as though there some wind or something which affects it. I believe that force could be what's causing this distortion but it's hard to say at this point, there's just so much wrong here that it seems like fixing one thing just reveals 2 more bugs. I was able to get it working on my smaller mesh, but maybe it's just so small that I haven't really noticed these issues. I'll have to go back into 2018 and see if this is regression.
     
    Last edited: Oct 14, 2019 at 8:22 PM
  34. unity_n2FvEnfvq2vehA

    unity_n2FvEnfvq2vehA

    Joined:
    Jan 27, 2019
    Posts:
    16
    I gave it a try, still on 2019.3.0b4. For me, nothing changes if I switch off mesh optimization. still get <1 fps and distorted cloth, maybe a little bit less distortion, but still completely unusable :(
     
  35. SomeGuy22

    SomeGuy22

    Joined:
    Jun 3, 2011
    Posts:
    507
    Distorted cloth during the Editor or playmode? Are you seeing glitchy/wild movement while running the game similar to what I just posted? For me, the mesh optimization trick eliminated problems in the Editor but didn't fix the wild movement when run.
     
  36. unity_n2FvEnfvq2vehA

    unity_n2FvEnfvq2vehA

    Joined:
    Jan 27, 2019
    Posts:
    16
    yes, in editor it looks now ok, in game mode not.