Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Resolved Dynamic Rigidbodies cannot sit stationary on top of each other (ECS)

Discussion in 'Physics for ECS' started by Jonathan_L, Sep 25, 2023.

  1. Jonathan_L

    Jonathan_L

    Joined:
    Jan 26, 2016
    Posts:
    38
    I am seeing an issue where dynamic rigidbodies in an ECS subscene cannot sit stationary on top of each other, but rather the top body would slide off everytime.

    Here are some screenshots, each pair of colored cubes is directly above the other.
    Blue: Cubes are not in an ECS subscene, standard Unity Physics
    Red: Cubes are in an ECS subscene
    Green: Cubes are in an ECS subscene, but the bottom green cube is kinematic

    Initial:
    upload_2023-9-24_21-57-20.png

    After a few seconds:
    upload_2023-9-24_22-1-36.png

    The top red cube eventually just falls off:
    upload_2023-9-24_22-2-28.png

    Any ideas why this might be happening or is there a fix for this?
     
  2. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,626
    If you need stability, try add a PhysicsStep component to a gameobject in a subscene and tick the Enable Contact Solver Stabilization

    upload_2023-9-25_14-47-6.png

    (Or give havok a shot if you have pro)
     
    apkdev likes this.
  3. Jonathan_L

    Jonathan_L

    Joined:
    Jan 26, 2016
    Posts:
    38
    Thank you so much. I don't have pro atm so I can't try Havok but this solution works.

    In case anybody wants to know, there is a tiny offset not seen with the other cubes, but this is no problem for me. Edit: If I increase the solver iteration count to around 24, the offset goes away and the red cubes sit perfectly on top of each other like the other ones.
    upload_2023-9-25_12-2-46.png
     
    Last edited: Sep 25, 2023
    daniel-holz and apkdev like this.