Body¶
Class ยท server and client scripts
Body configures how an entity simulates under physics: motion mode, damping, gravity scaling, axis locks, mass, sleep state, and force or impulse methods. Access it through entity.Body after adding Component.Body.
Motion¶
Motion sets how the physics solver moves the body: "Static" locks it in place, "Dynamic" simulates gravity, collisions, and forces, and "Kinematic" moves only when scripts write its transform.
Default "Static"
Enabled¶
Enabled turns physics simulation on or off for this body without removing the component.
Default true
GravityScale¶
GravityScale multiplies world gravity for this body. 1 is normal gravity, 0 is weightless, and negative values pull upward.
Default 1
LinearDamping¶
LinearDamping slows linear motion over time. 0 applies no drag.
Default 0.3
AngularDamping¶
AngularDamping slows angular spin over time. 0 applies no drag.
Default 0.5
LockPositionX¶
LockPositionX prevents the body from moving along the world X axis.
Default false
LockPositionY¶
LockPositionY prevents the body from moving along the world Y axis.
Default false
LockPositionZ¶
LockPositionZ prevents the body from moving along the world Z axis.
Default false
LockRotationX¶
LockRotationX prevents the body from rotating around the world X axis.
Default false
LockRotationY¶
LockRotationY prevents the body from rotating around the world Y axis.
Default false
LockRotationZ¶
LockRotationZ prevents the body from rotating around the world Z axis.
Default false
Mass¶
Mass is the total mass of the body's assembly in kilograms, or nil while the body is not simulated.
Sleeping¶
Sleeping is true while the solver has put the body to rest until a force, contact, or transform change wakes it.
ApplyImpulse¶
ApplyImpulse applies an instantaneous linear impulse v in world space, optionally at world point at.
Example
ApplyForce¶
ApplyForce applies a continuous linear force v in world space during the next physics step, optionally at world point at.
Example
ApplyTorque¶
ApplyTorque applies a continuous angular torque v around world axes during the next physics step.
Example
ApplyTorqueImpulse¶
ApplyTorqueImpulse applies an instantaneous angular impulse v around world axes.