PhysicsReadyTag
An empty IComponentData tag added at the very end of LittlePhysicsBootstrapSystem. When this tag exists, native buffers, settings blobs, and the physics world entity are fully allocated and safe to read.
Use PhysicsReadyTag as the single readiness gate for custom systems. You do not need to require each physics singleton component individually.
When bootstrap adds it
Bootstrap runs once during Initialization and performs work in a fixed order:
- Build the settings blob from baked
PhysicsSettingsAuthoringdata. - Allocate native structures (
BodiesList, spatial maps, collision buffers, and related pools). - Create the physics world entity with
PhysicsStructuresComponent,PhysicsFixedSettingsComponent,PhysicsVariableSettingsComponent, andSimulationDataComponent. - Add
PhysicsReadyTagon a separate entity and disable the bootstrap system.
Until step 4 completes, no physics import, fixed-step, or export systems run.
Gating custom systems
In OnCreate, require the tag so your system never updates before physics is ready:
[BurstCompile]
public partial struct MyPhysicsSystem : ISystem
{
[BurstCompile]
public void OnCreate(ref SystemState state)
{
state.RequireForUpdate<PhysicsReadyTag>();
}
}
Every internal Little Physics system — import, gravity, collision, export, and the fixed-step group — uses the same pattern.
Bootstrap also requires a baked
PhysicsSettingsAuthoringentity in the world. Without it, settings and native memory are never created andPhysicsReadyTagis never added.
Accessing singleton data
After the tag is present, read shared physics state with the usual Entities singleton APIs:
var fixedSettings = SystemAPI.GetSingleton<PhysicsFixedSettingsComponent>();
ref var simulation = ref SystemAPI.GetSingletonRW<SimulationDataComponent>().ValueRW;
var structures = SystemAPI.GetSingleton<PhysicsStructuresComponent>();
The tag lives on its own entity; settings and structures live on the physics world entity. SystemAPI.GetSingleton<T>() resolves either way as long as exactly one instance exists.
Related
- How it works — Bootstrap
- Pipeline — Initialization
- SimulationDataComponent — per-tick body count and job handle