Search Unity

Rigidbody ramming into the ground

Discussion in 'Physics' started by Haupstimme, Apr 26, 2015.

  1. Haupstimme

    Haupstimme

    Joined:
    Oct 4, 2013
    Posts:
    1
    I guess this is the right place to post this.

    I've recently been working on a platformer with a reverse gravity script I made that sets physics.gravity to negative when the player enters a reverse gravity trigger. This works exactly as intended, and all rigidbodies in the level float to the ceiling while gravity is reversed, and fall back down when you enter the trigger again and set gravity back to its normal value.

    The issue I'm running into is if you get on top of a rigidbody while it's rising and jump once, the rigidbody will fall to the ground, and typically will end up falling through the ground and being stuck. The "ground" in this scenario is just a normal box collider. This issue is a bit strange, since it doesn't happen often, but since it carries the possibility of making the level completely unbeatable, I have to do something about it.

    I'm not sure if this is a typical problem or one that's been encountered before, I've done a few searches for it and haven't been able to come up with a concrete answer. Any help is appreciated.

    In case it matters, the "sinking" happens most often on blocks that are 2 or fewer units thick in the X direction. I've seen it happen to rigidbodies with drag set to 0 as well as some set to 2. The current mass of these objects is 0.1.
     
  2. andrew-lukasik

    andrew-lukasik

    Joined:
    Jan 31, 2013
    Posts:
    249
    It may be caused, for example, by reaching 'escape' velocity (i.e. very high one). To falsify that you may want to log it as it happens.