1
votes

The Problem: Mesh colliders on some rigidbody objects are passing through colliders on other objects.

Things I have tried:

With the assumption A is a GameObject with a RigidBody attached and B is a normal GameObject with a collider.

  • Give A a convex mesh collider
  • Give A a non-convex mesh collider
  • Give B a convex mesh collider
  • Give B a non-convex mesh collider
  • give B a box collider
  • give B a convex mesh and box collider
  • give B a non-convex mesh and box collider
  • Adjusting the weight of the rigidbody

I have tried all of these in all combinations of A and B.

In addition,

  • Colliders are not marked as triggers
  • All objects are on the default layer (0)
  • Checking isKinematic; doing this seemed to make gravity stop affecting the object, so I have left it as false.

Constraints: I want A to use a mesh collider since most of the objects involved are moderately complex, and fitting other colliders to them would take a while.

Weird Behaviour: I have some objects with both rigidbody and convex mesh collider where the collision is working fine with a non-convex mesh collider. This is inconsistent with other gameobjects. The objects have all of the same settings.

I am using unity version 2019.3.11f1 if that is relevant.

The object being used are from this package. Specifically, the filing cabinet with rigidbodies on the drawers works fine. The desk, office chair, pen, and open laptop all fall through the "floor" (a cube with all of the above colliders tested on it).

2

2 Answers

1
votes

Do you have 'isKinematic' checked on the objects with rigidbodies that are going through other colliders? If so uncheck it so that external forces affect it.

edit you also need to click convex on the mesh colliders if they are colliding with other mesh colliders, Convex Mesh Colliders are limited to 255 triangles, are the objects that are not passing through have more than 255 triangles in geometry?

0
votes

I am Assuming you have set your Collision Detection to Discrete In your gameObject's RigidBody, if so, please make sure to select Collision Detection to Continuous In your gameObject's RigidBody.

Reason Why this is not working

  1. You are trying to use collision that has (speed > your Computer's frame speed) so, the frame is not catching the collider properly some time catches and some time fails to catch.

  2. You are moving your GameObjects with tranform.translate or position etc. If so then make sure to use Rigidbody Related function for Positioning, rotating.

Solution Image For First Problem