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

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.

4844681--465716--upload_2019-8-11_11-19-9.png
4844681--465719--upload_2019-8-11_11-19-43.png
this is another approach, with the skirt isolated…
4844681--465728--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)…

I have the exact same problem!

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.

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 :frowning: 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.

Just wondering if this issue is still causing trouble to you @TayouVR @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

In unity 2019.3.0b6 seems to have it somewhat better, but still buggy. They claim its fixed… but it clearly still isn’t…

ee65x

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.

I just set “optimize mesh” in the fbx import to nothing. it doesn’t work either… still behaves wierdly

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.

1 Like

I’m sorry but what in the actual fuck is wrong with cloth components. It broke in 2018.3 something with boundary issues. Now it happens even in 2019.3. Cloth stretches like hell. Why… just why cant you keep some things as they were working before… This is absolute agony to work with… I can’t rely on anything because it breaks every single hotfix release…

2 Likes

During the beta phase of 2019.3 (b1 to b12) cloth issues have been greatly reduced. But they are definetely still there in f1.
Some friends were able to use their mesh with no issues… I still have some issues on the skirt and other people have reported of having issues too.
Tweaking the export settings in blender may help, but Unity really has to fix this stuff…

That’s just the nature of regression. New features even in unrelated components often overlap causing issues somewhere else. Normally they are able to find and patch this stuff relatively quickly, maybe within a month or so if it’s critical. This time though, I’ve been having issues for the past 3 or 4 months so I don’t know what the hold up is. However, I’m not one to assume that this is even remotely an easy task, so instead of screaming at them I find it’s more productive to actually provide test cases that can narrow down the issue and make it easier to find. In other programs this wouldn’t be as a big of an issue considering you can decrease the version and use an older build, but I don’t think Unity 2019 projects can be converted into 2018 easily. They’re at least aware of what’s going so I wouldn’t doubt that they are doing everything they can. If not, it would be prudent of them to put it on high priority as it’s probably going to become a huge bottleneck for many projects soon.

It looks like the bug is still marked as “Active” on the issue tracker instead of “Planned/fixed” so it’s possible they’ve already discovered more things to fix. The 2019.3.0f1 build isn’t actually listed as “official” yet, so it’s not technically released right now. Perhaps that’s why they’re delaying it, or maybe they will just push back the fixes to some 2019.3.x build.

Hi there boys and girls!
It appears that I managed to fix my cloth problem by following these steps(after all that I tried to fix the cloth on my basketball net I don’t really know which of these steps helped me solve the issue, but it seems to be working for now in editor and builds!). What I did(Using Unity Editor v 2019.3.0f3) after cloth was broken upon porting to a newer version:

-Obvious first step- BACKUP YOUR PROJECT NOW
-Now prepare to remove the prefab with the cloth component from the scene AND project, you have backup dont worry :slight_smile: you have to do it from scratch to work with this method(sorry I couldn’t find any other way)
-Delete the prefab containing the cloth component from the scenes and from the project, also removed 3d model source files from the project, maybe a reimport would fix it for you but it did not fix it for me…
-Reimport the 3d models, if you click the root FBX files and go to “Model” settings you have to disable mesh optimisation(from everything to none). I think they changed the optimisation of the models which f****d up our cloths.
-A wierd optional step which I recommend is if you are using multiple monitor setup for the time of fixing your cloth you should shrink your workspace to just 1 window(I can’t really say if it helped, but I was finally able to fix the problem when I did it by recommendation of a friend).
-At this point I would like to mention that when trying to paint my constraints with the brush the brush still did NOT WORK. Also at some camera angles I was unable to see any of constraints in the editor window. Instead of paint mode go to “Select” mode in the constraint painting popup, select your vertices you want to affect, tick the checkbox for MaxDistance and set your value there.
-Pray to a random entity of your choice that it’s fixed.
I believe this was all it took to make it work again, I guess there was some incompatibility between mesh optimisations and the cloth component, so doing it from scratch atm looks like it fixes the problem, at least for me… Good luck, commanders

2 Likes

Wow. That’s one major pain a few weeks before release to have to redo all our cloths.

It work for me when I turn the Optimize Meth setting to Nothing .

I didn’t even have to do that to get my cloth working mostly as expected. If you use Unity 2019.3.4 the basic features should be back to normal. In my testing it seems as though some weird forces are still applied to Cloth but they aren’t too noticeable and might be because of me using random velocity, though even at small values it has a bigger than expected effect. Surface penetration also isn’t working as it bugs out cloth behavior, you can vote for the issue here. Other than that my replication tests for previous Unity versions all pass, cloth gravity is correct and they aren’t flying around like crazy anymore.

I’ve also looked into Magica Cloth which I’ve been told is a good alternative to Unity’s component, and may have some crucial stylistic advantages/optimizations due to virtual cloth points. I haven’t bought it yet since it seems like Unity’s 2019.3.4 Cloth should be good enough for now, but if you’re intent on having something potentially more stable you can check out Magica here. Though be warned, there’s no guarantee of any fixes when you buy an asset and there may be problems with Magica right now. But the dev behind it seems to be very responsive and proactive on adding new features/fixes.