Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Question 2D Physics in DOTS

Discussion in 'Physics for ECS' started by mati2762, Jun 11, 2023.

  1. mati2762

    mati2762

    Joined:
    Dec 26, 2017
    Posts:
    27
    When does Unity plan to implement 2D physics in the ECS package?
     
    Enderlook likes this.
  2. FaithlessOne

    FaithlessOne

    Joined:
    Jun 19, 2017
    Posts:
    330
    Probably never. But you can simply use the ECS 3D Physics and achieve the same results. Bodies have to have a bit of volume along the Z axis while the center of the body is at Z = 0. Otherwise all Z values for rayscasts and the like are always 0. That's all.
     
  3. JMPM-UNITY

    JMPM-UNITY

    Unity Technologies

    Joined:
    Jun 16, 2021
    Posts:
    94
    Hey, there have been many users asking for 2D physics in the ECS package. Remember that you can also share your voice and ask for new features on our website: https://unity.com/roadmap/unity-platform/dots (Under "submit a new idea").
     
  4. Unifikation

    Unifikation

    Joined:
    Jan 4, 2023
    Posts:
    1,122
    How about you just "get it done"?
     
    dannyalgorithmic likes this.
  5. ChickenVegetable

    ChickenVegetable

    Joined:
    May 3, 2020
    Posts:
    87
    Given that it's calculating in 3 dimensions would there be any performance advantage over not using DOTS at all for a simulation of many hundreds of 2D rectangles with some very basic behaviours?
     
  6. FaithlessOne

    FaithlessOne

    Joined:
    Jun 19, 2017
    Posts:
    330
    If you want reliable numbers you had to compare both via profiling. ECS Physics has been built for handling immense amounts of physical objects. It uses multithreading builtin and relies on Burst compilation. In classic Physics 2D multithreading is still an experimental feature. I would expect some hundreds 2D rectangles are easily handled. But you can also take a look at the ECS Physics Samples:
     
    ChickenVegetable and JMPM-UNITY like this.
  7. filod

    filod

    Joined:
    Oct 3, 2015
    Posts:
    226
    pls tell me at least it's under consideration...