roblox-physics
Official sources:
Use mechanical constraints to connect parts and mover constraints to apply forces or velocity targets. For older code, use the BodyMover migration table below.
Core concepts
Assemblies
An assembly is one or more parts connected by rigid welds or movable joints, simulated as a single rigid body.
Key
properties (same for any part in the assembly):
- / : prefer constraints or over direct assignment for realistic motion.
- : force here produces pure linear acceleration.
- : sum of all part masses; infinite if any part is anchored.
- : automatically chosen root for replication and network ownership.
Root-part priority: anchored > non-massless > higher
> size/name heuristics.
Anchoring
- Anchoring one part in an assembly makes it the root; the rest are implicitly anchored.
- Anchoring multiple parts in the same assembly splits it.
- To anchor an entire assembly, only anchor the root part.
Collision filtering
Use collision groups (
Workspace:RegisterCollisionGroup
(inherited from
),
) or
for part-to-part filtering.
,
, and
control different behaviors; see
references/collisions-and-filtering.md.
Mechanical constraints
All mechanical constraints connect one or two
s (or
s), except
and
which use
/
.
| Constraint | Use case |
|---|
| Rigidly lock two parts together, same relative transform |
| Same as WeldConstraint but attachment-based, supports bones |
| Doors, levers, rotating parts; motor/servo optional |
| Sliding doors, elevators, pistons |
| Slides + rotates, like hydraulic rams or landing gear |
| Springs, shocks, suspension |
| Rotational springs |
| Shoulders, ball joints |
| Drive shafts, constant-velocity joints |
| Cables, winches, maximum length |
| Fixed separation distance |
| Constrain motion to a plane |
| Disable collisions between two specific parts |
See references/mechanical-constraints.md for creation, orientation, motor/servo tuning, and limits.
Mover constraints
Modern replacements for deprecated
s:
| Legacy | Modern | Use case |
|---|
| | Move attachment to a position or another attachment |
| | Align orientation; for tracking |
| | Maintain constant velocity along vector/line/plane |
| | Maintain constant angular velocity |
| / | | Apply constant force |
| + | Follow + face target |
| - | | Apply constant torque |
| - | | Force along line between two attachments |
| - | | Constraint driven by animation/transform |
See
references/mover-constraints.md for force modes (
vs
), relativity frames, rigidity, and reaction forces.
Network ownership
- The server owns anchored parts.
- Unanchored parts near a player character are automatically owned by that client.
- Set ownership explicitly with
BasePart:SetNetworkOwner(player)
(server only). Reset with SetNetworkOwnershipAuto()
.
- Assign vehicle/driver ownership carefully: the first seated player may own the whole assembly otherwise.
Security: clients can exploit owned parts (teleport, fake collisions). Validate gameplay-critical events server-side. See references/network-ownership.md.
Sleep system
Assemblies stop simulating when still to save performance. They wake on collisions, property changes, impulses, or gravity/wind changes.
- If a slow mechanism falls asleep, increase motion or use actuated joints (motor/servo constraints) which get stricter sleep thresholds.
- Visualize sleep states with Awake parts in Studio's Visualization Options.
Physics stepping method
Workspace.PhysicsSteppingMethod:
- Fixed (default, 240 Hz): best general choice; use for racing, destruction, tanks, or when most parts already solve at 240 Hz.
- Adaptive: assigns assemblies to 60/120/240 Hz islands for up to ~2.5× performance in suitable experiences.
Use the MicroProfiler to check island distribution.
Units quick reference
| Roblox | Metric |
|---|
| 1 stud | 28 cm |
| 1 RMU | 21.952 kg |
| 196.2 studs/s² | default "Classic" gravity |
| 35 studs/s² | "Realistic" gravity (≈ 9.8 m/s²) |
See references/units-and-physical-properties.md.
Common mistakes
- Using deprecated s instead of modern constraints.
- Setting every frame instead of using forces/constraints.
- Anchoring every part in an assembly (splits it and hurts performance).
- Ignoring network ownership on vehicles and then wondering why input lags.
- Trusting events from client-owned parts for damage/authority.
- Letting actuated joints fall asleep prematurely.
Scripts
scripts/VehicleController.lua
: chassis setup with steering and motor drive, with client ownership and server validation.
- : motorized/servo door with limits and state machine.
scripts/PlatformMover.lua
: + platform with configurable waypoints.
- : spring-damper suspension using .
How to proceed
- Decide if the object is a rigid mechanism (mechanical constraint) or force-driven (mover constraint).
- Plan assemblies, root parts, and anchoring strategy.
- Set network ownership for multiplayer responsiveness.
- Tune forces/velocities using units and physical properties.
- Profile with MicroProfiler and watch sleep/ownership visualizations.
<!-- catalog:references:start -->
Reference index
- collisions-and-filtering.md: Configure collision groups, touch events, or spatial query filters.
- mechanical-constraints.md: Connect parts with hinges, springs, ropes, or other mechanical constraints.
- mover-constraints.md: Apply forces or velocity targets, or migrate BodyMover code.
- network-ownership.md: Assign physics simulation to the server or a player and debug ownership.
- units-and-physical-properties.md: Tune mass, density, friction, force, or simulation stepping.
<!-- catalog:references:end -->