0

I am new to Unity and having trouble with 3D physics.

I imported a basic 3D "U" bar shape and applied Rigidbody and Mesh Collider. When I drop another object let's say a ball, it does not go into the shape. When I select the shape, I realized a green line between to edges of the U shape which seems like Unity recognizes it as rectangular object.

How I can make Mesh Collider the follow imported mesh's exact shape?

Thank you.

Shape: enter image description here Properties: enter image description here Mesh Collider: enter image description here

Vetuka
  • 1,523
  • 1
  • 24
  • 40

1 Answers1

2

Your shape is not convex so if you check the convex option then Unity3d will modify collision shape to be convex. mesh collider not matching shape

To fix that, try to uncheck the convex option.

Panda Strong
  • 171
  • 5
  • Hi thanks for the response. Why a box collider does not collide with this object then? They both have rigidbody compartment assigned? That was the reason I started playing with convex, and when I did check convex than they started the collide. – Vetuka May 24 '20 at 14:36
  • 1
    From documentation: "GameObjects that have a Rigidbody component only support Mesh Colliders that have Convex option enabled: the physics engine can only simulate convex mesh colliders.". To enable collision you need to check convex option, otherwise it won't collide. A typical solution is to add many small simple colliders (e.g. box collider, capsule collider) to cover the whole complex object. – Panda Strong May 25 '20 at 05:50