Documentation 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.
CharacterController provides collision-constrained movement without a full physics simulation. Unlike Rigidbody, it is not affected by forces — it only moves when you explicitly call Move() or MoveTo(). This makes it ideal for player characters where you want precise, predictable motion. This page covers all properties and methods available on CharacterController.
CharacterController requires no collider sibling — it builds its own capsule trace shape internally using Radius and Height.Adding a character controller
Properties
Capsule shape
The radius of the controller’s capsule in world units. Range 0–200.
The total height of the controller’s capsule in world units. Range 0–200.
Read-only. The local bounding box of the capsule derived from
Radius and Height. Spans (-Radius, -Radius, 0) to (Radius, Radius, Height).Movement parameters
Maximum height of a step or ledge the controller can climb automatically. Range 0–50.
Maximum surface angle (in degrees) that is considered walkable ground. Surfaces steeper than this are treated as walls. Range 0–90.
The acceleration rate used by
Accelerate(). Higher values make the character reach target velocity faster. Range 0–64.How much velocity is reflected when the controller hits a wall mid-air.
0 stops dead on impact; 1 is a full elastic bounce. Range 0–1.State
Current velocity of the character in world units per second. Synchronized over the network via
[Sync]. Set this directly to override movement.true when the controller is standing on a walkable surface. Synchronized via [Sync]. Updated every time Move() is called.The
GameObject the controller is currently standing on, or null if airborne.The specific
Collider the controller is standing on, or null if airborne.Collision filtering
When
true, collision filtering uses the project’s collision rules applied to the GameObject’s tags. When false, IgnoreLayers is used instead.Tags of objects the controller should pass through. Only active when
UseCollisionRules is false.Methods
Movement
Advances the character by the current
Velocity over Time.Delta, resolving collisions and stepping up surfaces. Calls CategorizePosition() internally to update IsOnGround. Call this once per OnFixedUpdate.Slides from the current position toward
targetPosition using trace-based movement. Useful for scripted motion such as ladder climbing. Pass useStep = true to apply step climbing.Adds velocity toward
vector, capped by the current Acceleration rate scaled by Time.Delta. You do not need to multiply by delta time yourself.Decelerates the controller.
frictionAmount scales how quickly speed bleeds off. stopSpeed sets the minimum effective speed used in the friction calculation, which prevents the character from skating at very low speeds.Disconnects the controller from the ground and adds
amount directly to Velocity. Use this for jumping.Tracing
Runs a trace from the controller’s current position in
direction using the controller’s capsule shape and collision filters. Useful for checking clearance before moving.Ground detection
After every call toMove(), the controller runs an internal ground detection step (CategorizePosition). It traces a short distance downward from the controller’s position:
- If
IsOnGroundis alreadytrue, the trace extends downward byStepHeightto handle step-down while walking. - If
IsOnGroundisfalse, the trace extends only 0.1 units (enough to detect a surface but not snap down from the air).
GroundAngle degrees of straight up. If the controller is moving upward faster than 40 u/s, no ground detection runs that tick.
A minimal player controller
Create the component
Add
CharacterController to your player GameObject and set capsule dimensions in the editor or on OnAwake.Apply input in OnFixedUpdate
Read input, compute a wish direction, and call
Accelerate and ApplyFriction. Then add gravity to Velocity. Finally call Move().Related pages
Character controller guide
Step-by-step walkthrough for building a complete player movement system.
Physics components
Rigidbody, colliders, and joints for physics-simulated objects.
Input API
Reading keyboard, mouse, and controller input.
Networking overview
How ownership and sync variables work in multiplayer.