s&box uses a component-based physics system built on Jolt Physics. This page covers the full API for all collider types, theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/facepunch/sbox-public/llms.txt
Use this file to discover all available pages before exploring further.
Rigidbody component, and the joint components that constrain bodies to each other.
Colliders
Colliders define the shape of an object for physics simulation. They can exist standalone (acting as static or kinematic bodies) or alongside aRigidbody (which controls dynamic simulation). All colliders share a common base class, Collider.
Collider base properties
All collider types inherit these properties fromCollider.
When
true, the collider is fixed in the world and never moves. When false and not attached to a Rigidbody, the collider is kinematic — it follows GameObject transform changes but is not driven by physics forces.Read-only.
true only when the collider is simulated by a Rigidbody with MotionEnabled. Returns false for static and kinematic bodies.When
true, the collider becomes a trigger volume. It detects overlaps but does not generate contact forces. Triggers fire OnTriggerEnter and OnTriggerExit.Read-only. When this is a trigger, lists all colliders currently overlapping it. When this is a regular collider, lists all triggers it is currently touching.
Read-only. The local bounding box encompassing all physics shapes in this collider.
Surface properties
Overrides the material friction for this collider. Accepts values above 1 for extra grip. Leave as
null to use the surface asset’s value.Controls how bouncy the collider is.
0 is fully inelastic; 1 is fully elastic. Leave as null to use the surface asset’s value.Reduces rolling speed for sphere and capsule shapes. Leave as
null to use the surface asset’s value.The surface asset that defines sound, footstep, and material properties. Individual
Friction, Elasticity, and RollingResistance overrides take priority over the asset’s values.A local velocity applied to the surface of the collider. Objects resting on this collider slide in this direction — useful for conveyor belts.
Trigger events
Fired when another collider enters this trigger volume.
Fired when another collider exits this trigger volume.
Fired with the entering
GameObject when any of its colliders enters this trigger.Fired with the exiting
GameObject when all of its colliders have left this trigger.Collider methods
Returns the velocity of this collider at the given world-space point, accounting for rotation.
Returns the closest point on any convex shape of this collider to the given world-space point.
Returns the world-space bounding box of all physics shapes attached to this collider.
BoxCollider
BoxCollider defines a rectangular box shape.
The full extents of the box from corner to corner in local space.
The center of the box relative to the
GameObject’s local origin.SphereCollider
SphereCollider defines a sphere shape. When the GameObject has non-uniform scale, the shape degrades to a convex hull approximation.
Radius of the sphere in local space.
Center of the sphere relative to the
GameObject’s local origin.CapsuleCollider
CapsuleCollider defines a pill-shaped capsule between two points.
Bottom center point of the capsule in local space.
Top center point of the capsule in local space.
Radius of the capsule’s circular cross-section.
ModelCollider
ModelCollider generates physics shapes from a Model asset’s embedded collision data.
The model whose physics parts are used to build shapes. If left unset,
ModelCollider attempts to auto-detect a sibling ModelRenderer and use its model.ModelCollider supports concave meshes (IsConcave returns true for mesh parts). Concave colliders are always static — you cannot attach them to a Rigidbody with MotionEnabled.Rigidbody
Rigidbody adds dynamic physics simulation to a GameObject. It requires at least one collider on the same object or a child object to generate the body’s mass and contact shapes.
Rigidbody properties
Enables or disables gravitational force on this body.
Multiplier applied to
PhysicsWorld.Gravity. Use 2 for double gravity, 0 to neutralize gravity without disabling it.Linear drag applied every physics step. Higher values slow linear movement faster.
Angular drag applied every physics step. Higher values slow rotation faster.
Sets the body’s mass when greater than zero. When zero, mass is automatically computed from attached collider shapes and their surface densities.
Read-only. The current computed or overridden mass of the body in kilograms.
Read-only. The center of mass in local space.
When
true, uses MassCenterOverride instead of the automatically computed center of mass.Custom center of mass in local space. Only active when
OverrideMassCenter is true.Current linear velocity. Read or write to get or set the body’s movement. On proxies (networked), returns the last synced value.
Current angular velocity in radians per second.
When
false, the body becomes kinematic — it still generates contacts but is not moved by forces.true when the physics engine has put the body to sleep due to low velocity. You can set this to false to wake it.When
true, the body starts in the sleep state on spawn.Flags that restrict movement on specific axes. Combine flags to lock, for example,
PhysicsLock.PositionZ | PhysicsLock.RotationX.Miscellaneous flags. Currently supports
DisableCollisionSounds to suppress automatic impact sound effects.Enables continuous collision detection against dynamic bodies. Use for fast-moving objects like bullets.
Forces contact manifolds to be freshly computed each frame instead of being recycled. Reduces ghost collisions on character-like bodies.
Speed in units per second below which the body enters sleep. Increase to improve stacking stability.
When
false, disables ICollisionListener events and collision sound triggers for this body.When
true, OnCollisionUpdate is also dispatched while a collision persists each frame.Read-only. The underlying
PhysicsBody handle. May be null when the component is disabled. Do not store — the body can be recreated.Read-only. All trigger colliders currently touching this rigidbody.
Read-only. All joints currently connected to this body.
Rigidbody methods
Applies a continuous force to the body at the center of mass. Force is accumulated and applied during the next physics step.
Applies a continuous force at a specific world-space point, generating torque when off-center.
Applies angular force (torque) to the body.
Applies an instantaneous velocity change (impulse) at the center of mass.
Applies an instantaneous impulse at a specific world-space point.
Cancels any accumulated forces that have not yet been applied to the body this frame.
Moves the body toward
transform using velocity rather than teleportation, cooperating with the physics solver. Good for grabbed objects.Position-only overload of
SmoothMove.Rotates the body toward
rotation using angular velocity, cooperating with the solver.Returns the world-space velocity at a specific point on the body, including the contribution of angular velocity.
Returns the closest point on any convex shape of this body to the given world-space position.
Returns the world-space bounding box of the physics body.
Gets or sets the inertia tensor diagonal. Set to override the auto-computed value; call
ResetInertiaTensor() to revert.Reverts
InertiaTensor and InertiaTensorRotation to the values automatically computed from attached colliders.Joints
Joints constrain two physics bodies relative to each other. All joints share a commonJoint base class. Place a joint component on any GameObject and set the Body property to the target. The joint itself anchors at the component’s GameObject by default.
Joint base properties
The
GameObject whose physics body this joint constrains. The joint searches the GameObject hierarchy upward for a Rigidbody or Collider. If none is found, the joint anchors to the world body.Optional override for the source body. Defaults to the
GameObject the joint component is on.When
true, the two connected bodies can still collide with each other.Maximum linear impulse the joint can sustain before breaking.
0 means indestructible.Maximum angular impulse the joint can sustain before breaking.
0 means indestructible.Read-only at runtime.
true when the joint has been broken.Fired when the joint breaks (either from exceeding
BreakForce/BreakTorque or by calling Break()).Read-only. The current linear impulse being applied to the joint this step.
Read-only. The current angular impulse being applied to the joint this step.
Read-only. The source physics body (the anchor side).
Read-only. The target physics body.
Joint methods
Breaks the joint immediately, firing
OnBreak. Has no effect in the editor.Re-creates a previously broken joint. Has no effect in the editor.
FixedJoint
FixedJoint welds two bodies together at a fixed relative offset. The constraint is soft — it uses spring-damper parameters rather than a rigid weld, which improves solver stability.
Spring frequency for the linear constraint. Higher values make the weld stiffer.
Damping ratio for the linear constraint.
1 is critically damped.Spring frequency for the angular constraint.
Damping ratio for the angular constraint.
HingeJoint
HingeJoint allows rotation around a single axis — like a door hinge or wheel axle. Optionally includes angle limits and a motor.
Minimum rotation angle in degrees.
Maximum rotation angle in degrees. When both limits are
0, the hinge has unlimited rotation.Motor mode.
Disabled applies only friction. TargetAngle drives toward a set angle with a spring. TargetVelocity spins at a constant rate with a torque limit.Passive resistance applied when
Motor is Disabled.Target angle in degrees for
TargetAngle motor mode.Spring frequency for the angle motor.
Damping ratio for the angle motor.
Target angular velocity in degrees per second for
TargetVelocity motor mode.Maximum torque the velocity motor can apply.
Read-only. Current hinge angle in degrees.
Read-only. Current rotational speed in degrees per second.
Read-only. The hinge axis in world space.
SpringJoint
SpringJoint tries to maintain a target distance between two bodies using spring forces. It can pull, push, or both.
The distance the spring tries to maintain between the two anchor points.
Minimum allowed distance. The spring never compresses below this.
Maximum allowed distance. The spring never stretches beyond this.
Spring stiffness. Higher values make the spring snap back faster.
Damping ratio.
1 is critically damped; values below 1 allow oscillation.Pull applies force only when stretched, Push only when compressed, Both applies force in both directions.SliderJoint
SliderJoint restricts a body to move along a single axis relative to another — like a piston or drawer.
Minimum slide distance.
Maximum slide distance.
Passive resistance applied to sliding motion.
BallJoint
BallJoint (ball-and-socket) allows free rotation in all directions — like a shoulder joint. Optional swing and twist limits constrain the range of motion.
Enables angular swing limits.
Minimum and maximum swing angles in degrees.
Enables angular twist limits.
Minimum and maximum twist angles in degrees.
Disabled uses only friction. TargetRotation drives toward a target orientation. TargetVelocity spins at a target angular velocity.Passive friction when the motor is disabled.
Related pages
Physics guide
Overview of the physics system, collision layers, and best practices.
Character controller
Kinematic character movement without a Rigidbody.
Scene & GameObjects
How objects and components are organized in a scene.
Networking overview
Syncing physics bodies across clients.