Search Unity

Gravity affects walking. A lot

Discussion in 'Physics' started by Runetass, Apr 20, 2015.

  1. Runetass

    Runetass

    Joined:
    Jun 4, 2013
    Posts:
    16
    Hi. I have a character, which I have sized to about the same size as official Unity characters. The rigidbody's drag is at 13.29. I found that a gravity from around -180 to -210 looked more correct, because -9.81 makes him fall super slow.

    When the gravity is that high, he can't move anymore, using AddForce. Drag doesn't affect it at that stage. Actually, changing the movement speed doesn't help, unless you start putting it over 20 000, in which case it starts acting unnatural as well - weird transitions between moving and not moving, inresponsive.

    Changing the scale could work, but it would him him superbly small compared to standard assets, and I wouldn't like that.

    What's Unity's meaning of this?
     
  2. 4ringz

    4ringz

    Joined:
    Apr 22, 2015
    Posts:
    13
    You're setting the values way too high for the physics engine to handle correctly. -9.81 is realistic gravity; the character is falling slowly because you're imposing massive unrealistic drag (which in reality would be nearly 0). Take a look at Unity's default character controllers and scenes for an idea of how to set this up correctly.
     
  3. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
    How did you even get yourself in a situation where you needed such extreme values? I use 1 unit = 1 meter for everything except pixel art 2D games where I use 1 unit = 1 pixel just for ease of use. In that case I have to tweak gravity a bit, but nowhere near as extreme as what you've done.

    Also take a look here: http://docs.unity3d.com/Manual/class-Rigidbody.html

    There's a section about using the right size and mass and a list of hints at the bottom.