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.

Feedback You describe Unity Physics as Stateless but it needs further clarification

Discussion in 'Physics for ECS' started by NWalker_FGOL_Ubisoft, Aug 20, 2020.

  1. NWalker_FGOL_Ubisoft

    NWalker_FGOL_Ubisoft

    Joined:
    Aug 10, 2015
    Posts:
    25
    Small thing: Obviously, between BuildPhysicsStep and ExportPhysicsStep, there is cached state. An employee on our team accidentally ran a system in-between those two, which changed entity archetypes. This lead to a strange bug where entities would swap translations.

    Thus, the existence of the physics world makes the Physics system not entirely "stateless", although obviously it is stateless in regards to the overall ECS flow.

    Recommended actionable:
    1. Add a caveat inside your stateless documentation.
    2. Create a sub-group inside the SimulationSystemGroup to handle the 3 physics steps. This will prevent new systems from having any chance of accidentally sitting between the three.
     
    Nothke, Orimay and steveeHavok like this.
  2. Sima_Havok

    Sima_Havok

    Joined:
    Dec 16, 2019
    Posts:
    48
    I agree about improving the documentation.

    Thing is that some systems can be run between the 3 and some doesn't. It depends what they do with the data. So second option would introduce unnecessary restriction for some users.