Cloth Physics and Vehicle Collision Meshes

I am experimenting with cloth physics and vehicle draping within unreal. The goal is to try and do as much if not all of the process purely within unreal if possible. I am dropping a cloth onto a static vehicle with the output being static images of the draped vehicle, so no animations factor into this.

I’ve got the cloth physics figured out but I’m running into issues when it comes to the vehicle collisions due to the limitations of cloth physics. Complex collisions do not interact with the cloth, so I am limited to simple and convex collisions. I’ve found two bugs/issues during my testing regarding collision meshes.

The first bug is when I alter the scale of my cloth in the editor, it no longer accurately collides with specifically simple box collisions when the box collision gets further away from the center of the object. This is fixed by returning the cloth to 1,1,1 scale so I’m mainly just pointing this one out, but the cloth would need to be scaled based on the size of the vehicle so this might still have some effect on our project.

The main issue I am running into is that there seems to be no way to use a static mesh as simple collision, it only lets you substitute a mesh for complex collision. The hope was to be able to use a low poly mesh of our vehicle as the collision in order to get an accurate silhouette when draped. Custom collision does work by modeling your own in a different software and bringing it in as a UCX but the amount of time and work it would take to make accurate collision meshes for every vehicle we have would ultimately defeat the purpose of doing this all in unreal. The auto convex collision tool in unreal is unusable when it comes to vehicles so the only option is the custom UCX route but that is not easily automatable.

The screenshot shows off both the box collision not interacting correctly due to the cloth scale being adjusted, and the issue of auto convex collision on the car not being accurate to the car shape. There are no blueprints involved at this point, its purely a skeletal mesh actor for the cloth and the vehicle as a static mesh actor.

[Attachment Removed]

Hello [mention removed]​

Thanks for reaching out.

I’ve been assigned this case and will be looking it up for you.

All the best,

[mention removed]​

[Attachment Removed]

Hello [mention removed]​,

I was able to reproduce the issues you described:

The scaling of the cloth actor in the scene is causing a mismatch between the surface of the cloth and the underlying collider.

Setting it back to (1,1,1) eliminated the mismatch.

During my tests, any sort of scaling other than (1,1,1), even uniform scaling, e.g., (0.5,0.5,0.5), results in this issue.

As you observed, this applies to Box or hard-edged colliders, while collision against sphere colliders seems unaffected.

If you want, I can dig deeper and try to understand the exact underlying cause, but I suspect this is either an engine optimization (Unreal being a realtime Engine does tend to compromise on some precision over performance gains), or a matrix math issue (non-uniform scaling is a class of problem on its own, and I’ve worked on many cases where it pops up).

Regarding the Auto Convex Collision Tool, during my tests, I was able to get some good results by increasing the Hull Count, Max Hull Verts, and Hull Precision numbers.

I kept increasing values and reached a limit, above which the Cloth asset started ignoring the car entirely and falling through, as if it were a complex mesh.

For the SM_SportsCar, as a reference, my limit was: Hull Count = 64; Max Hull Verts = 32; Hull Precision = 757037.

Anything over this, and cloth ignored it.

Of course, this is all heavily dependent on your particular setup, so I suggest you experiment on your side.

It would be good to hear more details on your requirements.

What exactly are you trying to do?

One issue I had while testing with the Auto Convex Collision Tool was the underlying mesh popping up from under the cloth.

I solved this by increasing the values as described above, but I also tried tweaking the Cloth Collision Thickness so it collides from further away:

  • Open up the Cloth_250 asset
  • Go to AssetDetails>Clothing>MeshClothingAssets>[0]>ClothingProperties>SkeletalMeshClothing>ClothConfigs>ChaosClothConfig>CollisionProperties>CollisionThickness
  • The default value was 5, but you can experiment with higher values and see what makes sense for you.
  • The inverse can also be used if you want a more detailed surface, but if it is too low, the cloth will also pass through the colliding mesh.

Let me know if any of this is useful.

I hope to hear from you soon.

All the best,

[mention removed]​

[Attachment Removed]

Hello [mention removed]​,

I’ve been informed that the engine does not support the non-uniform scale case.

All the best,

[mention removed]​

[Attachment Removed]