Search Unity

(Fix) Physics Not Working For Seemingly No Reason

Discussion in 'Physics' started by almand, Feb 16, 2022.

Thread Status:
Not open for further replies.
  1. almand

    almand

    Joined:
    Apr 4, 2018
    Posts:
    1
    Hello,

    I'm not sure where I would report this bug but I also wanted it to be open for everyone to see since I spent forever and a lot of frustration trying to fix this problem. Hopefully this will help anyone else that runs into this problem.

    I am on Unity 2021.2.0b12.3482 and I have a script that sets the Timescale to 0 to pause the game. I have found that if I close Unity (or it crashes) while the script has the Timescale set to 0 during playtime, it will keep it at 0 in the project settings causing physics to not work until it is manually reset to 1.

    How to fix:
    Go into Edit > Project Settings > Time and you will see the Timescale option at 0. Change this to 1.

    Hopefully this helps!
     
  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,500
    The Time Manager isn't controlled by Physics nor is it a physics system. Setting the TimeScale to zero also stops the Animation, Particles system (etc) and it has nothing to do with them either as it's a global setting that everything that uses time, uses.

    If your script changes it outside of Play Mode then it will be persisted, like other settings so this would be expected.

    Your fix isn't really a fix; I suspect most people know how to set the Timescale.

    If you suspect a bug then please create a bug report.

    FYI though, this post is more related to Scripting or Editor.
     
  3. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,512
    Looks like a bug to me. File a bug report (use Unity's bug reporter) with a simple script and instructions on how to reproduce the issue consistently.
     
    Last edited: Feb 17, 2022
  4. ysundawa

    ysundawa

    Joined:
    Mar 2, 2020
    Posts:
    33
    I just found similar with 2021.2.7f1, gravity is not working, all my vehicle are floating..
    checked the TimeScale option it is properly set to 1 .....

    Now trying to download latest 2021.2.12f1 and see if it works with this version
     
  5. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,500
    In what way is what you're talking about related to the above post? Are you referring to "Physics Not Working" as a general thing? o_O

    Gravity isn't broken on a specific version of Unity, that would be insane if that were true. This isn't something that is changed at all. In-fact for both 2D and 3D physics, we just pass on the setting to the physics engine which themselves are not changing much over time.
     
  6. Tinniman

    Tinniman

    Joined:
    Dec 14, 2020
    Posts:
    49
    Hi. I can confirm that this is some real stuff. If the game crashes while in running mode. My timescale is set to 0.
    Unity 2021.3.10f1. I pulled my hairs before I saw this post. Thanks for figuring this out!
     
    CloudyVR likes this.
  7. akuno

    akuno

    Joined:
    Dec 14, 2015
    Posts:
    88
    What about these:
    Time scale is set to 1, but physics still doesn't work.




     
  8. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,500
    Because it's a completely different problem. Please don't necro threads because the title sounds similar; simply create your own thread and describe your problem.

    In your case, you've told Unity to not simulate. Look at the "Auto Simulation" checkbox, it's off.

    Thanks.
     
    akuno likes this.
Thread Status:
Not open for further replies.