Log inGet started
◇
component · drop-in viewer
asset⌬ componentcomponentprimary: init.luau·originates fromworld 07158574-5…

Physics

Adds rigid body dynamics to an entity. Body kind is `"dynamic"` (affected by forces), `"static"` (immovable), or `"kinematic"` (moved by script, affects other bodies).

byzero-proxy @ DESKTOP-DB3UJOJ·posted 2mo ago
What it does

Physics

Adds rigid body dynamics to an entity. Body kind is "dynamic" (affected by forces), "static" (immovable), or "kinematic" (moved by script, affects other bodies).

Public fields: kind, gravityScale, mass, linearDamping, angularDamping, ccd, interpolation, lockRotationX/Y/Z, lockTranslationX/Y/Z.

ccd (continuous collision detection) sweeps the body along its motion so it cannot pass through thin geometry between two steps. It is off by default: the sweep runs on every body that travels further than its own thickness in one step — most of a collapsing structure or a debris burst — and it dominates the physics budget when a scene has many such bodies. Turn it on for the individual bodies that would visibly tunnel: bullets, thrown props, a wrecking ball.

entity(id).component.add("Physics", { kind = "dynamic", ccd = true })

Methods: :applyForce(x, y, z), :applyImpulse(x, y, z), :applyTorque(x, y, z), :setVelocity(x, y, z), :addVelocity(dx, dy, dz).

entity(id).component.add("Physics", { kind = "dynamic" })
entity(id).component.get("Physics"):applyImpulse(5, 0, 0)

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

Physics Component Adds rigid body dynamics to an entity. `kind` (renamed from `type` because `type` is a framework-reserved proxy field) is one of "dynamic" (affected by forces), "static" (immovable), or "kinematic" (moved by script, affects other bodies). Config is the native Physics ECS component, driven through the typed `ecs.Physics` API. Per-entity actions (applyForce, applyImpulse, ...) run through the `ecs.get` handle's behavior methods, bound to this entity. Usage: entity.find("box1").component.add("Physics", { kind = "dynamic" }) entity.find("box1").component.get("Physics"):applyForce(0, 10, 0) entity.find("box1").component.get("Physics"):applyImpulse(5, 0, 0)

capitalize(s: ?) → void

argtypedescription
s?

physicsValue( ) → void

Build the typed ecs.Physics value from the public fields. bodyType takes the capitalized variant name the reflect enum expects ("Dynamic" / "Static" / "Kinematic").

insertPhysics( ) → void

Upsert the native body, recreating it from scratch (a body-type change must rebuild the Rapier body). Sync so the lock writes below land on this body.

awake( ) → void

onPropertyChanged(key: ?, value: ?, oldValue: ?) → void

argtypedescription
key?
value?
oldValue?

onDestroy( ) → void

applyForce(x: number, y: number, z: number) → void

Apply a continuous force to this body (Newtons).

argtypedescription
xnumberForce component along world X.
ynumberForce component along world Y.
znumberForce component along world Z.

examples

body:applyForce(0, 100, 0)

applyImpulse(x: number, y: number, z: number) → void

Apply an instantaneous impulse to this body (kg·m/s).

argtypedescription
xnumberImpulse component along world X.
ynumberImpulse component along world Y.
znumberImpulse component along world Z.

examples

body:applyImpulse(5, 0, 0)

applyTorque(x: number, y: number, z: number) → void

Apply a torque to this body (rotational force).

argtypedescription
xnumberTorque around world X.
ynumberTorque around world Y.
znumberTorque around world Z.

examples

body:applyTorque(0, 5, 0)

setVelocity(x: number, y: number, z: number) → void

Set the body's linear velocity directly.

argtypedescription
xnumberVelocity component along world X.
ynumberVelocity component along world Y.
znumberVelocity component along world Z.

examples

body:setVelocity(0, 10, 0)

addVelocity(dx: number, dy: number, dz: number) → void

Add to the body's current linear velocity.

argtypedescription
dxnumberVelocity delta along world X.
dynumberVelocity delta along world Y.
dznumberVelocity delta along world Z.

examples

body:addVelocity(0, 2, 0)

Sub-parts

Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.

3items
·
other · born here
▤file
▲ 0↑ born
backing path · components/Physics.component

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported. This asset, its contents, and its direct deps are clean as of the latest commit.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.