Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Feedback Rigidbody high acceleration freeze up game/editor. Unity should cap acceleration or show error

Discussion in 'Physics' started by CYCLE-6, Nov 29, 2022.

  1. CYCLE-6

    CYCLE-6

    Joined:
    Jul 26, 2017
    Posts:
    7
    So in Unity 2021.3.13. I'm working with rigidbody and AddForce function. I found out my game would randomly freeze up when triggering "explosion" in my game.

    Turns out it was the explosion force accidentally applied to some very small, very light objects. The acceleration was too high and it freeze up my game.

    More specifically, it was the bullet casing drooped on the floor. I do have object pool will recycle casing after some time. But if an explosion occurs nearby before the casing got recycled, it will put the entire game into a freeze.

    Edit: I just found that it only happens if the RigidBody collision detection is set to "continuous speculative" mode. I must've turned that option by accident.

    No errors, no warnings, and even the System.Diagnostics.Stopwatch will freeze so it won't give you the correct timing of function exception. This problem is very difficult to debug if you don't have prior knowledge and didn't pay attention to such a detail.

    I suggest that Unity should cap the max acceleration of an object and/or show an error message if a rigidbody's acceleration is too high.
     
    Last edited: Nov 30, 2022
  2. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,558
    Looks like a serious issue to me. I'd recommend you to file a bug report with a minimal repro case.
     
  3. CYCLE-6

    CYCLE-6

    Joined:
    Jul 26, 2017
    Posts:
    7
    OK will do.
    Would you suggest reporting here on the forum as new bug post? Or report to their support services?
     
  4. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,558
    Use the bug reporter. Prepare a minimal project where the issue can be clearly reproduced (like pressing Play and Unity freezes), then submit it via Help menu > Report a Bug.

    When you receive a case number, you may post it here so devs can refer to it.
     
  5. CYCLE-6

    CYCLE-6

    Joined:
    Jul 26, 2017
    Posts:
    7
    Roger that! ∠(°-°)
     
    Edy likes this.
  6. CYCLE-6

    CYCLE-6

    Joined:
    Jul 26, 2017
    Posts:
    7
    Just submitted the bug report, got an email with a number "IN-24501" that's the case number right?
    BTW I just found out that it only happens if the collision detection mode is set to "Continuous Speculative". I must've accidentally chose that option by mistake. :p
     
  7. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,558
    Yes, that's the case number. Unity stuff can now test the issue, determine the Unity versions affected, and take the steps to resolve it.

    The information about Continuous Speculative is great, ensure it's added to the case information if you hadn't included it earlier.