Component · physics2d
PhysicsPose2d
World-space 2D pose, written back by the solver at every completed boundary.
Fields
position
vec2Body origin or character capsule centre, in world space.
default [0,0]mreplicated · relevant, linear, rollback
rotation
f32Counter-clockwise rotation about +Z.
default 0radreplicated · relevant, linear, rollback
Usage
Every edit is an undoable command: from the CLI as below, or the same JSON from an agent over MCP. See component.add and property.set.
Add it
ara do component.add -p entity=name:Crate -p component=PhysicsPose2d --why "Add PhysicsPose2d"Set a field
ara do property.set -p entity=name:Crate -p path=PhysicsPose2d.position -p value=[0,0] --why "Tune PhysicsPose2d"In a scene document
{
"PhysicsPose2d": {
"position": [
0,
0
]
}
}From C#
/// <summary>Reset a platform body above the floor.</summary>
public static void UsePhysicsPose2d(Entity entity, in Tick tick)
{
ref var component = ref World.Get<PhysicsPose2d>(entity);
component.Position = new Vector2(0, 2);
}From C#
Scripts read and write it with Get<PhysicsPose2d>(); see the PhysicsPose2d struct.