0
\$\begingroup\$

I'm using Unity 2020.3.2f1 and I have a very commonly seen problem. I have a Spherecollider which I am using for a physics game, and geometry that uses BoxColliders or MeshColliders. Everything is nice until I get to the seams of one of these objects, and then my ball loves to do inane things like come to a complete stop across a seam or bounce high into the air when striking one. These seams are very tiny as you can see in the image below.

seams

So, I've tried basically every workaround in the physics engine and rigidbody options for my ball (continuous, changing timestep, etc), and none of them completely erase the issue. I suspect that unless I marry all the colliders together, decimating points within some tolerance of each other into one, I will always have this problem at least in some cases, which isn't acceptable for my project.

So I'm wondering how I would work with this data. How do I access the MeshCollider data of each object in the scene? If I join them into a "master mesh" how does it expect to be constructed (quads from vertices or something)? Is there a performance aspect to worry about, having one giant collider versus many tiny ones? I imagine it screws with pruning colliders in the collision detection portion.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Searching for "unity combine MeshCollider" turns up this $10 asset as one of the very first hits. Did you try it, or something similar? \$\endgroup\$
    – DMGregory
    Apr 24, 2021 at 15:45
  • \$\begingroup\$ @DMGregory Unfortunately that has only one review and very little information. It is not clear to me that it will actually merge nearby verts instead of just weld meshes without merging (so small overlaps would still be in the mesh). I need nearby but not perfectly overlapping verts to weld like I mentioned. Besides, big picture, I think having the knowledge of the system I want to work with is more desirable over finding something to do it for me... \$\endgroup\$
    – Empty Set
    Apr 26, 2021 at 2:09

0

You must log in to answer this question.

Browse other questions tagged .