Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

[2019.2.0f1][Bug] Cloth component seems to not work properly in some situations

Discussion in 'Editor & General Support' started by SupraLP, Aug 11, 2019.

  1. SupraLP

    SupraLP

    Joined:
    Apr 12, 2018
    Posts:
    3
    i am creating content for an upcoming game and i have made a custom humanoid model in blender, that i exported as an FBX and imported into unity then. until now i was able to use cloth on that models skirt. But after upgrading to 2019.2 setting up cloth is wierd and its gravity is reversed. Sometimes it freaks out completely... For testing i have put cloth on a plane and that worked without any issues. I don't know, why cloth acts so wierd on my custom mesh. on 2019.1.10f1, 2017.4.15f1 and 2017.4.28f1 it worked perfectly fine.

    upload_2019-8-11_11-19-9.png
    upload_2019-8-11_11-19-43.png
    this is another approach, with the skirt isolated...
    upload_2019-8-11_11-31-10.png

    if you want that skirt for reproducing and testing, ask me. i can give you the isolated skirt. But you should be able to archieve the very same results with any mesh (with or without armature, doesn't matter) from blender (and probably any other 3D modelling software)...
     
  2. PiggyBanks

    PiggyBanks

    Joined:
    Nov 23, 2015
    Posts:
    5
    I have the exact same problem!


    upload_2019-8-13_12-56-54.png

    It was fine this morning before I updated from 2019.1 to 2019.2. Let me know if you find a fix, I'll let you know if I find one.
     

    Attached Files:

  3. SomeGuy22

    SomeGuy22

    Joined:
    Jun 3, 2011
    Posts:
    529
    Same is happening to me. This seems like an extremely critical bug. I've tried damping, stretching and bending stiffness, surface penetration options, constraints, solver frequency, friction, everything. I even played around with the external accel a bit but it did nothing to help.



    The cloth gravity appears to be no longer in the downward world direction. That's my best explanation for it, but I also got some inflation when my cloth had thickness and I'm not sure if that's related.

    This is the second time I can think of where cloth has been just completely broken from a major update :( back in Unity 5 there was a bug that consistently caused Unity to crash while using cloths which didn't get patched for months. Anyways, I realize it's hard to code for because it's likely tied in closely to everything, so let's just try to get a dev to figure out the issue. I really need it fixed within the next few weeks as it makes up such a huge part of my character and don't want to be tweaking last minute. I even tested it with other objects to make sure it's not my mesh and sure enough the cloth goes flying sideways.

    I'm going to submit a bug report and see what the Unity team can do. Reproducing it is extremely simple: if you place a plane down and add a cloth with the default settings, it won't fall in playmode. It'll just fly off to the side. If you constrain the top vertices to be distance: 0, then you'll get the bottom part floating as if it had no gravity, as seen in the screenshot.

    EDIT: Looks like there's already an issue tracker submission for this. It says there's a fix in review so maybe we'll get an update soon. Go vote on it if you can so they'll put it on priority.
     
    Last edited: Aug 14, 2019
  4. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    389
    Just wondering if this issue is still causing trouble to you @SupraLP @PiggyBanks @SomeGuy22? (I'm using Unity 2019.2 and export FBX from Blender.)

    I bumped into similar problem yesterday, spent hours wondering what was causing the cloth to literally explode to a mess and bounce around the screen, or sometimes more mild effects happened, like the cloth got seemingly pulled upwards or some area of the cloth crumpled. No matter what settings I adjusted in Cloth, I couldn't get rid of these faults.)

    What caught my eye was when I brought in various debug objects from Blender was that some of the vertices started to move to weird directions when cloth simulation was started. With a cylinder that had the top edge pinned to place, vertex from bottom of the cylinder got moved up to a vertex in top of the cylinder, pulling majority of cloth there... I knew my meshes were most likely totally OK in blender and in the FBX file, so something must have happened to them when I imported them. So, I checked import settings, disabled all optimizations and suddenly those errors didn't happen any more.

    So I think at least in some situations importer might be the reason. At least it was for me.

    My settings were these:
    (I didn't start yet to debug what of the settings actually causes that fault for me)
    Mesh Compression: Off
    Optimize Mesh: Nothing
    Keep Quads: unticked
    Weld Vertices: unticked
    Index Format: Auto

    ( I doubt that these rest will affected to the outcome but I list them anyway:)
    Legacy Blend Shape Normals: unticked
    Normals: Import
    Blend Shape Normals: Calculate
    Normals Mode: Area and Angle Weighted
    Smoothing Source. Prefer Smoothing Groups
    Smoothing Angle: 60
    Tangents: Calculate Mikktspace
    Swap UVs: unticked
    Generate Lightmap UVs: unticked
     
  5. SupraLP

    SupraLP

    Joined:
    Apr 12, 2018
    Posts:
    3
    In unity 2019.3.0b6 seems to have it somewhat better, but still buggy. They claim its fixed... but it clearly still isn't...


    upload_2019-10-8_20-42-36.png
     
  6. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    389
    Did you try to disable optimizations? And then reimport the model after that. Not sure if it's necessary but just in case it refreshes some data in Unity.

    That faulty operation looks just like what I had here.
     
  7. SupraLP

    SupraLP

    Joined:
    Apr 12, 2018
    Posts:
    3
    I just set "optimize mesh" in the fbx import to nothing. it doesn't work either... still behaves wierdly
     
  8. SomeGuy22

    SomeGuy22

    Joined:
    Jun 3, 2011
    Posts:
    529
    The issue tracker which I linked was only about the bug with Cloth gravity, and it is fixed. The replication test was to put a plane with cloth and rotate it 90 degrees, only to see the plane fly in a weird direction in playmode. If you perform the test in new versions of Unity you will see that it doesn't happen anymore, thus the issue tracker claims it is fixed.

    There are other cloth-related bugs which have separate reports and issue trackers that I believe are still being looked at. Check out this thread for more information. I recently submitted a bug report with my findings from that thread but I never got an email back so the reporting system might've glitched out.

    EDIT: The mesh optimization fix worked for me when I got Cloth distortion and stretching in Editor. Looking closer at your picture its possible your colliders are causing the cloth to move weirdly, make sure you have them set where you want them, and try disabling colliders to see if it behaves as expected.
     
    Last edited: Oct 14, 2019
    Imperatoss likes this.