- Home /
How to use non-convex mesh collider with dynamic rigid body physics?
Hi
I am working on a unity game project for Android Platform.
The main goal of the application is to draw shapes with touch and once user draws the shape, it should fall to the ground.
I am using line renderer. Once user touch phase ends, I attache mess collider and add rigid body but it shows error message: "Non-convex MeshCollider with non-kinematic Rigidbody is no longer supported since Unity 5"
If I use edge collider then it works fine. But the problem with edge collider it fails collision with other similar object which has edge collider. Thats why opted mesh collider.
How could I overcome this problem. Any guidance will be helpful. Thanks.
Please look at the image. The yellow part is user drawn shape. Red marks are the desired colliders I want. Hope it helps.
Are you doing 2D or 3D physics? Becasue a mesh collider is for 3D, Edge collider for 2D.. so I am a bit confused
Hi Panga$$anonymous$$i. Thanks for your response. I am doing 2d project.
Answer by Pangamini · Oct 26, 2019 at 06:26 PM
If you are using 2D physics, you can use Polygon Collider 2D, it converts the concave to a set of convex polygons automatically, defining the inside/outside area.
Hi. I want collider exactly on the space of drawn shape. If user draws 'c' then the collider should appear on the dark spot of c. Look at the image. The yellow part is the user drawn shape. Red marks are desired colliders I want.