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 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:
    52
    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.