Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    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,497
    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,497
    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,497
    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.