Component · physics2d
RigidBody2d
Rigid-body authoring settings; simulation state is written to pose and velocity.
Fields
motion
MotionType2dStatic, kinematic, or dynamic motion.
default "static"
One ofstatickinematicdynamic
mass
f32Mass in kilograms; zero computes mass from the collider's 1 kg/m2 area density.
default 0kg≥ 0
allowSleep
boolPermit inactive bodies to sleep.
default true
continuous
boolUse swept collision detection for fast bodies.
default false
lockRotation
boolPrevent physical rotation, for upright props and platforms.
default false
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=RigidBody2d --why "Add RigidBody2d"Set a field
ara do property.set -p entity=name:Crate -p path=RigidBody2d.motion -p value="static" --why "Tune RigidBody2d"In a scene document
{
"RigidBody2d": {
"motion": "static"
}
}From C#
/// <summary>Give a 2D pickup a small physical mass.</summary>
public static void UseRigidBody2d(Entity entity, in Tick tick)
{
ref var component = ref World.Get<RigidBody2d>(entity);
component.Mass = 2f;
}From C#
Scripts read and write it with Get<RigidBody2d>(); see the RigidBody2d struct.