Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Let us know a bit about your interests, and if you'd like to become more directly involved. Take our survey!
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Gravity not working on rigidbody

Discussion in 'Editor & General Support' started by sciguy77, May 4, 2010.

  1. sciguy77

    sciguy77

    Joined:
    Nov 1, 2009
    Posts:
    191
    Hi,

    I have a rigidbody and I have checked the "use gravity" box however it does not fall. I then tried to use rigidbody.useGravity, though there was still no effect.
     
    Rotecks and ocimum like this.
  2. GargerathSunman

    GargerathSunman

    Joined:
    May 1, 2008
    Posts:
    1,572
    Is the rigidbody kinematic? It ignores the gravity if isKinematic == true.
     
    ocimum likes this.
  3. sciguy77

    sciguy77

    Joined:
    Nov 1, 2009
    Posts:
    191
    Nope, the kinematic box is unchecked. :/

    I also added:

    Code (csharp):
    1.  
    2. rigidbody.isKinematic = false;
    3.  
    4. rigidbody.useGravity = true;
    5.  
    but still nothing...
     
    ocimum likes this.
  4. GargerathSunman

    GargerathSunman

    Joined:
    May 1, 2008
    Posts:
    1,572
    Well, that leaves three options. One, it's colliding with something and can't fall. Two, it's so big that you can hardly see it move. Three, the visible object isn't the object being affected by gravity.

    Unless I can see the scene I can't really say one way or the other.
     
  5. sciguy77

    sciguy77

    Joined:
    Nov 1, 2009
    Posts:
    191
    I've attached a screenshot of the scene. The car's mass is 3000 kg, and I can move it forward and turn it fine, it just does not fall.[/img]

    As you can see, the correct boxes are checked. Anyone know why this is happening?
     

    Attached Files:

  6. sciguy77

    sciguy77

    Joined:
    Nov 1, 2009
    Posts:
    191
    Any idea why this is happening?
     
  7. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    In the editor, select debug mode for the inspector. Then, set the game playing to a point where the car should be falling. Then, switch to the scene view and select the car in the inspector. If gravity is working, you should see the Y position value of the transform decreasing. If this is happening, but the car doesn't seem to be falling then it probably means that the scale of the models in the scene is enormous. Essentially, it is like looking at vast objects from a great distance. It is common for a 3D app's export options to make an object a hundred or a thousand times larger or smaller than it should be. You can fix this at the modelling stage or else change the scale values in the object's transform within Unity.
     
  8. KHopcraft

    KHopcraft

    Joined:
    Jun 6, 2009
    Posts:
    3,247
    Lower the drag of the rigidbody.
     
  9. Veerababu.g

    Veerababu.g

    Joined:
    Oct 8, 2015
    Posts:
    2
    even am facing the same problem any help
     
    Rotecks likes this.
  10. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    514
    Same here, maybe it's the Unity build.. I'm using 5.3.2f1
     
    Rotecks likes this.
  11. jacovberg

    jacovberg

    Joined:
    Nov 28, 2014
    Posts:
    1
    Edit > Project Settings > Time
    Time Scale should be set to 1
     
    luisConstante and malanoga like this.
  12. MFKJ

    MFKJ

    Joined:
    May 13, 2015
    Posts:
    101
    what happened solved?
     
  13. Darioszka

    Darioszka

    Joined:
    Jan 22, 2015
    Posts:
    9
  14. patr15

    patr15

    Joined:
    Apr 5, 2017
    Posts:
    1
    For me it helped to uncheck the checkbox "static" in the inspector (in top-right corner)
     
  15. enunez810

    enunez810

    Joined:
    Dec 1, 2016
    Posts:
    1
  16. diegoadduci

    diegoadduci

    Joined:
    Jun 24, 2017
    Posts:
    1
    for me too!! thanksss!!!
     
  17. tlucz

    tlucz

    Joined:
    Apr 11, 2014
    Posts:
    1
    It can be also "Freeze Position" on Y axis checked.
     
    llamapuppies likes this.
  18. TheCreatorOfExistence

    TheCreatorOfExistence

    Joined:
    Sep 6, 2017
    Posts:
    1
    my characters go up as soon as i start
     
  19. Rotecks

    Rotecks

    Joined:
    Dec 17, 2014
    Posts:
    49
    I have the same very magical problem. I still do not believe in it, but I can observe in my project. There are 2 cube in the scene. Cubes have a mesh-renderer, colliders, physics and nothing else. The cube 1 is on the cube 2. These cubes are dynamic, their sizes are normal and the mass is 1 kg. I do not change the gravity of the cube 1, just do not touch it.

    Then begins the magic.
    If I run the project, cube2's RB.isKinematic = true and call Cube2GameObject.SetActive(false) through Editor, then all as usually, сube1 falls down.

    If I do the same on mac, but I change the position of the cube2 through RB.position, then the cube 1 hangs in the air. If it is slightly pushed, it falls.

    I'm not looking for an answer to what's going on, I think that nobody will help with this, except Unity's team.
     
  20. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,010
    Can you file a bug report with a sample project? We can take a look and see what's going on.
     
  21. Darren_Therrien

    Darren_Therrien

    Joined:
    Jun 30, 2016
    Posts:
    23
    Yep.. That did it thanks. Was driving me nuts. Large trees would fall even though static but smaller would not. Hmmm?
     
  22. TommH

    TommH

    Joined:
    Mar 22, 2018
    Posts:
    1
    I've been experiencing a similar problem and it was because the rigidbody was going to sleep due to inactivity. Calling rigidbody.WakeUp() or applying a small force solved my issue.
     
  23. augivision

    augivision

    Joined:
    Mar 27, 2018
    Posts:
    9
    I FIGURED IT OUT!

    The scale of your object in the scene has everything to do with it. If your object is scaled too large in the scene, even with a mass of 99999999999999999999999 it will not move.

    I scaled my entire scene down and Everything works great!
    Thank you andeeee!


    EDIT:

    Instead of scaling your scene down and rearranging your assets, it's easier to change the amount of pull in the negative Y direction for gravity in the physics manager. No matter what scale your scene is, adjust this should fix your issue.



    https://imgur.com/a/NvJJw
     
    Last edited: Apr 2, 2018
  24. alejandro93

    alejandro93

    Joined:
    Mar 10, 2015
    Posts:
    2
    Check Edit->Project Settings->Physics2D and check "Auto Simulation".

    And also check "Simulated" in rigidbody component.
     
  25. SquareMike

    SquareMike

    Joined:
    Apr 30, 2013
    Posts:
    1
    My God man, you saved us from a life of travesty. Did you hurt yourself when you fell from heaven? We would not have thought of this were it not for your 4 year younger self. No sarcasm truly; but do you know why it happens?