Create additional physics worlds so you can simulate separate groups of objects under different conditions, such as different gravity values, in the same scene.
Note: This documentation is about using Pose, Area, and Constraint components. To use 2D physics in the Unity Editor using components like the Rigidbody 2D component, refer to 2D physics instead.
Unity automatically creates a default world that every 2D Physics Core component belongs to. Unity creates or recreates the default world at the following times:
To adjust the properties of the default world, refer to Configure global 2D Physics Core settings.
To create your own world, for example to have two areas with different gravity values in the same scene, follow these steps:
Repeat these steps for every object you want to add to the new world.
For more information, refer to Physics Simulation World asset reference.
To adjust a world’s properties, such as gravity, follow these steps:
For more information, refer to Physics Simulation Definition asset reference.
By default, Unity destroys a world when nothing references it anymore, for example if you disable every Physics Pose component in the world. If you re-enable a component, Unity creates the world again from the Physics Simulation World asset.
To keep a world alive, create a GameObject with a Physics Simulation component instead. Follow these steps:
Unity now keeps the world alive for as long as the Physics Simulation component stays enabled.
To keep this GameObject alive when a new scene loads, enable Persist Across Scenes. This affects the whole GameObject, not only the Physics Simulation component.
For more information, refer to Physics Simulation component reference.