Hello Guest

Author Topic: my rigidbody go throw the ground with box collider  (Read 4881 times)

stevexu

  • Newbie
  • *
  • Posts: 29
    • View Profile
my rigidbody go throw the ground with box collider
« 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.
« Last Edit: August 06, 2013, 03:13:19 pm by stevexu »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: my rigidbody go throw the ground with box collider
« Reply #1 on: August 06, 2013, 05:45:18 pm »
Try increasing the collider depth to around 100. See if that improves things?

stevexu

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: my rigidbody go throw the ground with box collider
« Reply #2 on: August 07, 2013, 01:49:06 pm »

Increasing the collider depth to around 1000. And  the box go throw the ground! any suggestion?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: my rigidbody go throw the ground with box collider
« Reply #3 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?

stevexu

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: my rigidbody go throw the ground with box collider
« Reply #4 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

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: my rigidbody go throw the ground with box collider
« Reply #5 on: August 07, 2013, 03:01:56 pm »
I don't know, it very much depends on the size of things.