- Home /
Wrong Mesh Generation
Hello, i have a disc with a hole in the center that i imported from maya. In Unity, when i add Mesh collider the collider generates all over the object i.e across the hole in the center making it useless...What should i do?
Then learn what convex is and realise where you went wrong :)
Answer by Pritamde12 · May 20, 2013 at 01:41 AM
Convex=your mesh collider wont have Holes or entrances. To add colliders to such objects where you need the holes you must make several child objects with primitive colliders such as box colliders. In the above case four box colliders can be used to cover the entire area of the disc and also doesnt disturb the hole in the center. This is the only way.
no actually there is a second way.
Cut the object in half and have 2 convex shaped colliders.
The best way though is to try to use non mesh colliders.
No, actually cutting it in half will cause the same problem, you would need to cut it into each separate convex shape, aka each piece of the circle
No, 2 halves of a circle with a hole is not convex, it's concave. It still has a concave "hole" in it. You'd have to split it into as many shapes as the edge is made of to get a concave collider.
It doesn't contain a hole (Thats why it was in quotes) but it is not convex, therefore the collision would still be the same. Try it out if you don't believe me! $$anonymous$$ake that shape, cut it in half and watch the two convex colliders make the same shape as it it weren't split.
@sparkzbarca: The convex hull can never go "inwards" so it never has a surface angle lower than 180° on the outside. If you cut the collider into two pieces the half-hole would still be "filled" because it goes inward. The convexhull in 2d is like a rubberband which you put around the object and let it shrink. Wherever the object has a concave shape the convex hull will "remove" them by making it "flat" at this point.
Your answer

Follow this Question
Related Questions
Why is my mesh collider not the same shape as the mesh of the object? 1 Answer
Mesh Collider, Convex Separating Meshes 1 Answer
mesh error 0 Answers
Mesh collider with a mesh created by code returns incorrect results. 3 Answers
Technique to find a mesh intersecting with a primitive solid without using colliders? 0 Answers