Search Unity

  1. 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


    Aug 10, 2015
    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


    Dec 16, 2019
    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.