2D Toolkit Forum

2D Toolkit => Support => Topic started by: stevexu on August 06, 2013, 03:00:29 pm

Title: my rigidbody go throw the ground with box collider
Post by: stevexu on August 06, 2013, 03:00:29 pm
This problem has troubled me for a long time, as shown below, the box will sometimes pass through the ground, I do not know why. I can detect a collision from OnCollisionEnter method.  I have set collider depth to 20 . From unity sense view,  I can see  the box  has the same collider depth as  ground (20).   If  set gravity as:  const float GRAVITY = -9.81f * 400  , then the box always pass throw the ground,  If  set gravity as:  const float GRAVITY = -9.81f * 500 , Most of the time it works fine,  Very few time the box go throw the ground. What's wrong ?

thanks sososo mush.
Title: Re: my rigidbody go throw the ground with box collider
Post by: unikronsoftware on August 06, 2013, 05:45:18 pm
Try increasing the collider depth to around 100. See if that improves things?
Title: Re: my rigidbody go throw the ground with box collider
Post by: stevexu on August 07, 2013, 01:49:06 pm

Increasing the collider depth to around 1000. And  the box go throw the ground! any suggestion?
Title: Re: my rigidbody go throw the ground with box collider
Post by: unikronsoftware on August 07, 2013, 01:51:51 pm
I don't know what else to suggest. If you want you can email a sample project to support at unikronsoftware.com and I could take a look?
Title: Re: my rigidbody go throw the ground with box collider
Post by: stevexu on August 07, 2013, 02:07:40 pm
Is  the gravity too big?   I set it as   -400x9.8  .  if  i set as -9.8,  it fall so  slow, but don't breakdown the  floor
Title: Re: my rigidbody go throw the ground with box collider
Post by: unikronsoftware on August 07, 2013, 03:01:56 pm
I don't know, it very much depends on the size of things.