Box Collider not stopping Rigidbody

So I have a rigidbody object that is supposed to collide with a box collider and stop (not bounce off). I am not quite sure what’s the right way to accomplish that, but what I’ve done is set the mass of the object to .1 and the drag to 10, which seems to work ok.

The problem is, sometimes (usually when the rigidbody is going fairly fast) it goes right through the box collider. The collider registers the hit in OnCollisionEnter, but doesn’t stop the object.

Is there another method I can use to prevent the player from being able to move the object offscreen?

This is just a guess but are you using FixedUpdate? http://unity3d.com/support/documentation/ScriptReference/MonoBehaviour.FixedUpdate.html

There isn’t any code at this point. All I’m using is the natural collision provided by the Rigidbody and Box Collider

Hm. That script didn’t seem to have any effect. The rigidbody in question is a sprite. Would that make a difference?

Timbecile

Are U sure your rigidbody object is not asleep ? I had this problem once, and it drowe me nuts until I realized that my objects were put to sleep by Unity. Try to call .awake() on the gameObject

/Chris

Try CCD (Continuous collision detection). Turn dynamic ccd on your rigid body and regular ccd on your static rigidbody.

I know this is really old, but I found an amazing video that helped me with this problem

If you are using transform.Translate the problem is that this overrides the physics in the object and does not work with collisions detection.