Object going through (or getting inside) another object

I am having an issue where a player object goes through (or gets inside) another object every once in awhile. I have heard of a “bullet through paper” problem, but I have done everything (as far as I can tell) to solve this issue.

  • I set collision detection on every object in the scene to Continuous Dynamic
  • I made the wall very, very thick
  • I set max speed of the player object to 30

The most annoying part of my problem is that I do not know what parameter causes this issue. I literally have to continuously bump my player object into a wall for about a minute to have it go inside a wall.

Anyways, is there anything else I can do to try to fix this issue?

Thanks!

How are you moving the object?

Collisions will only be calculated for the object if you move using the MovePosition, AddForce or velocity methods on the rigidbody. Using a simple vector translate is often the cause of this problem.

The other cause is to ensure that the object has colliders attached and that they are NOT set to triggers. The other one is that the rigidbody is not kinematic either.

As well as this mesh colliders cannot collide with other mesh colliders. As such for more complex objects sometimes it is better to use simple bounding boxes for the collisions as opposed to auto generated mesh colliders.