Custom character controllers and physics

How characters really move on Roblox, from the Humanoid to physics controllers, the Character Controller Library and Server Authority, and how Beacon Yard checks moves on the server.

Concept lesson, about 85 minutes, 12 steps

By the end you can

  • Explain who simulates a Roblox character by default and why that lets clients cheat movement
  • Compare the Humanoid, ControllerManager physics controllers, the Character Controller Library and Server Authority
  • Drive an object with mover constraints and see how network ownership decides whose input counts
  • Write a server-side sanity check for reported movement, using Beacon Yard's real walk speeds

Before this: Security: never trust the client, Physics: constraints, assemblies, network ownership

1Who moves your character?

Buy Speed in Beacon Yard's shop and you run at 24 studs a second instead of 16. The server makes that change, in DataService:

function DataService.applySpeed(player: Player)
	local profile = profiles[player]
	local character = player.Character
	if not profile or not character then
		return
	end
	local humanoid = character:FindFirstChildOfClass("Humanoid")
	if not humanoid then
		return
	end
	humanoid.WalkSpeed = if profile.speedOwned then Config.BOOST_SPEED else Config.WALK_SPEED
Figure 1.1

So the server sets the speed. But when you press W, your own device moves your character, frame by frame, and sends the result up. By default the clientClientOne player's device running its own copy of the game for display and input.Think of it as your screen and controller at home. simulates its own character: it holds the ball, in network-ownership terms1. That is why walking feels instant even on a slow connection, and it is the root of every speed hack.

In stock Beacon Yard, a player with Speed walks across the yard. Which machine works out where their character is each frame?

  1. That player's own device, which then replicates the position to the server
  2. The server, which then tells the player's device
  3. Every client, each on its own
  4. Nobody; the Humanoid is a pre-recorded animation
Answer

That player's own device, which then replicates the position to the server. The client owns its own character's physics by default. The server's WalkSpeed is the rule the client's Humanoid follows; the movement itself is computed on the player's device.

Open this step in lesson mode · Link to this step · This confused me

2What the Humanoid does for you

The Humanoid

A Humanoid is the engine object that turns a model into a character2. It reads input direction, walks, jumps, climbs ladders, swims, falls over and gets up, through a fixed set of states (Enum.HumanoidStateType). It also holds health, applies avatar clothing and accessories, and plays the default animations. You tune it with properties such as WalkSpeed and JumpHeight; you cannot change the state machine inside it.

For most games this is exactly right. Beacon Yard uses the stock Humanoid and changes only WalkSpeed. Teams leave the Humanoid when they need movement it cannot do (wall-running, momentum skating, a vehicle that is also a character), or when they need movement the server can verify.

Which of these are good reasons to replace the default Humanoid movement?

  1. A wall-run and slide system with momentum
  2. A competitive shooter where speed hacks must be impossible, not just detected
  3. A slightly faster walk for players who bought Speed
  4. A hovering drone character that ignores gravity
Answer

A wall-run and slide system with momentum; A competitive shooter where speed hacks must be impossible, not just detected; A hovering drone character that ignores gravity. Faster walking is WalkSpeed, which Beacon Yard already sets. Momentum movement, a non-walking character and server-verified movement are where custom controllers earn their cost.

Open this step in lesson mode · Link to this step · This confused me

3The controller picture breaks

Client sideRemember: The client is your screen and controller at home.

Players picture their device as a screen and a controller, with the game somewhere else. For their own character, that picture is wrong. Answer before you open the breakdown.

Where does it break?“Your screen and controller at home” is a good picture of the client. Where does it stop being true?

It breaks here. The client also simulates your own character's movement and sends it up, so it is more than a screen.

The true model. Each player's device runs its own copy of the game for display and input. It owns its character's physics by default, which is why movement feels instant and why a cheater can move strangely.

An exploiter sets their own Humanoid's WalkSpeed to 100 on their client in stock Beacon Yard. What do other players see?

  1. The exploiter running at 100, because their device simulates their character and its position replicates
  2. Nothing changes, because the server's WalkSpeed is 16
  3. The exploiter is kicked automatically
  4. Only the exploiter sees themselves move fast
Answer

The exploiter running at 100, because their device simulates their character and its position replicates. The server's WalkSpeed property still says 16, but the client computes the position and the server accepts it. Unless something checks movement on the server, everyone sees the fast character.

Open this step in lesson mode · Link to this step · This confused me

4What Beacon Yard checks instead

Beacon Yard never trusts a position for anything that pays out. A coin pays only when the server measures the character close enough, whatever the client says about touching it:

		-- A touch is only a hint. Check the character's root is close
		-- enough to the coin before paying.
		local character = player.Character
		local rootPart = if character then character:FindFirstChild("HumanoidRootPart") else nil
		if rootPart == nil or not rootPart:IsA("BasePart") then
			return
		end
		if (rootPart.Position - coin.Position).Magnitude > 12 then
Figure 4.1

That stops "collect every coin from across the map". It does not stop a fast runner from reaching coins sooner. To catch that, the server has to look at movement itself: sample each root part's position, and ask whether the distance since the last sample was possible at that player's speed. Before pressing Run, predict which of the four cases below returns false, and notice why the fourth case is a false positive.

Luau with roblox-lite (not Roblox)
-- Beacon Yard's speeds, from Config.luau
local WALK_SPEED, BOOST_SPEED = 16, 24
 
-- A first try at a server-side move check: no further than walkSpeed * dt.
local function isPlausible(fromPos: Vector3, toPos: Vector3, dt: number, walkSpeed: number): boolean
	return (toPos - fromPos).Magnitude <= walkSpeed * dt
end
 
local spawnPad = Vector3.new(-30, 3, 0)
local east = Vector3.new(1, 0, 0)
print("walked 16 studs in 1 s:", isPlausible(spawnPad, spawnPad + east * 16, 1, WALK_SPEED))
print("moved 24 studs in 1 s, no upgrade:", isPlausible(spawnPad, spawnPad + east * 24, 1, WALK_SPEED))
print("moved 24 studs in 1 s, Speed owned:", isPlausible(spawnPad, spawnPad + east * 24, 1, BOOST_SPEED))
print("fell 60 studs in 1 s:", isPlausible(spawnPad + Vector3.new(0, 60, 0), spawnPad, 1, WALK_SPEED))
Figure 4.2. Expected output: walked 16 studs in 1 s: true moved 24 studs in 1 s, no upgrade: false moved 24 studs in 1 s, Speed owned: true fell 60 studs in 1 s: false

The last line prints false for an honest player falling off a crate. What is wrong with the check?

  1. It measures the full 3D distance, so falling counts as running; only horizontal distance should be limited
  2. WALK_SPEED is too low
  3. The fall should have used BOOST_SPEED
  4. Vector3 subtraction is not allowed on the server
Answer

It measures the full 3D distance, so falling counts as running; only horizontal distance should be limited. Gravity is not the player's choice. Compare only X and Z, add a tolerance and a little slack for lag, and reject NaN or infinite positions. That is the level 3 challenge.

Open this step in lesson mode · Link to this step · This confused me

5Physics controllers: ControllerManager

Under the Humanoid, Roblox has a lower-level, scriptable system. A ControllerManager drives a character's root part with physics, and you give it controllers for each kind of movement: GroundController, AirController, ClimbController and SwimController3. Sensors (ControllerPartSensor) report the floor or a climbable surface under the character. Your script picks the active controller and sets MovingDirection and FacingDirection; the controllers apply forces to reach them.

Because the movement is ordinary physics, it interacts properly with moving platforms, slopes and pushes, and you can tune acceleration and friction per controller. The cost: you write the state logic the Humanoid used to give you, and you test it on every device.

Match each piece to its job.

  1. ControllerManager
  2. GroundController
  3. ControllerPartSensor
  4. MovingDirection
Answer

ControllerManager: Owns the root part and switches between controllers; GroundController: Walking and running on a floor; ControllerPartSensor: Reports the surface under or in front of the character; MovingDirection: The direction your script asks the character to move. The manager holds the controllers and the root part, sensors find surfaces, each controller handles one kind of movement, and MovingDirection is your input.

Open this step in lesson mode · Link to this step · This confused me

6The Character Controller Library

In April 2026 Roblox released the Character Controller LibraryCharacter Controller LibraryRoblox's Luau character movement built from abilities on top of ControllerManager.Think of it as the Humanoid's state machine, taken apart into pieces you can read and replace. (CCL) for live games: a Luau implementation of character movement, built on ControllerManager, that you switch on in Avatar Settings > Movement instead of the legacy Humanoid movement4. Movement is a set of abilities (running, jumping, climbing) that declare when they start and what they block, coordinated through labels5.

Three cautions, checked on 2026-11-25. The docs page now opens with a beta notice, "The CCL is currently in beta", and asks you to turn on the AvatarAbilities Character Controller Library beta feature first, even though the April post called the library a full release5. The custom abilities API arrived as a Studio beta, and its 5 November 2026 update renamed functions and fields, so code written against older posts breaks6. And ability callbacks run in both a predicted client simulation and the authoritative server simulation, so they must be deterministic.

Roblox Studio
Roblox Studio's Avatar Settings window on the Movement tab, with Character Controller Library selected and the list of default abilities checked.

Select a numbered pin, or a row below, to read what it marks.

Figure 6.1.

Avatar Settings, Movement tab. The pins mark the Humanoid or Character Controller Library choice and the default abilities.

A teammate pastes a custom CCL ability from a forum post written in September 2026, and it errors. What is the most likely reason?

  1. The custom abilities API is a Studio beta and was renamed in November 2026
  2. The CCL only works in Studio, never in live games
  3. CCL abilities must be LocalScripts
  4. The CCL was removed
Answer

The custom abilities API is a Studio beta and was renamed in November 2026. The custom abilities API is a beta whose names changed (for example Config became Configuration), and the docs page now marks the whole CCL as beta, so check the date of anything you copy.

Open this step in lesson mode · Link to this step · This confused me

7Moving with constraints

You do not need a character to learn the physics underneath. Mover constraints push parts toward a goal: LinearVelocity holds a velocity, AlignOrientation turns a part toward an orientation7. A yard cart is a good test bed, and it shows exactly how ownership decides whose input counts.

Build along

m06-drone-wrench

  1. In a new Baseplate place (not the Beacon Yard project), add a part named Cart, size 4, 2, 6, unanchored, with an Attachment at its centre.

    You should see A 4 x 2 x 6 unanchored part sits on the baseplate of a new test place.

  2. Add a LinearVelocity (Attachment0 = the attachment, VelocityConstraintMode Vector, RelativeTo World, VectorVelocity 0, 0, 0) and an AlignOrientation (Attachment0 = the attachment, Mode OneAttachment, Responsiveness 20).

    You should see In Play, the cart holds still on flat ground and turns to face -Z (the front of CFrame.identity).

  3. Add a server Script that calls Cart:SetNetworkOwner(player) for the first player who joins, and a LocalScript that sets VectorVelocity from the keys every frame.

    You should see On Play, holding W in the client moves the cart, and a second player in a two-player test sees it move.

  4. Change the server script to Cart:SetNetworkOwner(nil) and play again.

    You should see Holding W now does nothing: the client's change to VectorVelocity never reaches the server, which owns the cart.

To drive a server-owned cart from player input, what do you send to the server?

  1. The input (throttle and steering) through a remote, and the server sets VectorVelocity after checking it
  2. The cart's new position, which the server copies
  3. Nothing; LinearVelocity replicates from clients
  4. The player's WalkSpeed
Answer

The input (throttle and steering) through a remote, and the server sets VectorVelocity after checking it. With server ownership, only server-side changes move the cart. Send input, validate it, apply it on the server. The cost is input lag, which is what client ownership or Server Authority's prediction hides.

Open this step in lesson mode · Link to this step · This confused me

8Server Authority: prediction and rollback

In July 2026 Roblox released Server AuthorityServer AuthorityEngine netcode where the server runs the real simulation and clients predict and roll back.Think of it as the referee plays the match; your controller only sends button presses, and your screen guesses ahead. to every creator8. With Workspace.AuthorityMode set to Server, the server runs the real simulation and clients send only their inputs. Each client predicts a few frames ahead so input still feels instant, then rolls back and resimulates when the server's state disagrees9. Setting the mode turns on what it needs: next-generation replication, the Input Action System, deferred signals, fixed-step simulation and streaming.

Your movement code goes in functions bound with RunService:BindToSimulation() in a module both sides run, reading time(), which rewinds during resimulation. tick() and os.time() do not rewind, so they cannot drive simulated state. This step introduces how custom controllers plug into Server Authority; Module 13's Server authority: prediction, rollback, lag-compensated hits teaches prediction, lag rewind and misprediction recovery in full depth with an interactive simulator.

Other ways pros do this

OptionWhat it isWhen pros pick itTrade-offs
Humanoid (default)Engine character with a fixed state machine.Most games, including Beacon Yard. Tune WalkSpeed and JumpHeight, check what matters on the server.Client-simulated; custom movement means fighting the state machine.
ControllerManagerPhysics controllers you drive from Luau.Custom movement that should still be physical: slopes, platforms, momentum.You write the state logic and test it everywhere.
Character Controller LibraryRoblox's Luau character built on ControllerManager, with abilities.New games that want Humanoid-like defaults plus custom abilities, and that plan for Server Authority.Its docs page carries a beta notice, and the custom abilities API still renames things.
Server AuthorityEngine netcode: server-run simulation with client prediction and rollback.Competitive games where movement cheats must be impossible.Deterministic code, extra setup, and visible corrections when prediction misses.
ChickynoidCommunity server-authoritative character controller, MIT.Older competitive projects built before Server Authority existed.Its repository's last push was in May 2024; prefer the engine feature for new work.

Inside a function bound with BindToSimulation, which clock should drive a moving platform?

  1. time()
  2. os.time()
  3. tick()
  4. os.clock()
Answer

time(). With AuthorityMode Server, time() is fixed-step simulation time shared by client and server, and it rewinds during resimulation. The others read the local device clock.

Open this step in lesson mode · Link to this step · This confused me

9Try it: the cart under Server Authority

Back to the yard cart. With plain server ownership, the client's key press had to travel to the server before the cart moved. Under Server Authority the cart stays server-owned, input travels as an input action, and the client can predict the result. The docs set three rules for this: input that affects the simulation goes through the Input Action System, an InputContext must sit under a Player, and movement code runs in a function bound with RunService:BindToSimulation() in a module both sides run9.

luau
-- ModuleScript CartSim in ReplicatedStorage. Both sides run it.
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
 
local CartSim = {}
 
local function anyoneDriving(): boolean
	for _, player in Players:GetPlayers() do
		local inputs = player:FindFirstChild("Inputs")
		local context = inputs and inputs:FindFirstChild("CartContext")
		local drive = context and context:FindFirstChild("Drive")
		if drive and drive:GetState() == true then
			return true
		end
	end
	return false
end
 
function CartSim.Initialize()
	local cart = workspace:WaitForChild("Cart")
	local velocity = cart:WaitForChild("LinearVelocity") :: LinearVelocity
	RunService:BindToSimulation(function()
		velocity.VectorVelocity = if anyoneDriving() then Vector3.new(0, 0, -16) else Vector3.zero
	end)
end
 
return CartSim

Inside the bound function only properties and methods marked Simulation Access may be used. LinearVelocity.VectorVelocity, FindFirstChild and InputAction:GetState() all are. Prediction can be forced per instance from the client with RunService:SetPredictionMode().

Build along

m06-drone-wrench

  1. Save your cart place under a new name, delete its network-owner Script and its LocalScript, and set Workspace > AuthorityMode to Server.

    You should see A copy of the cart place is open. Workspace.AuthorityMode reads Server, and NextGenerationReplication, PlayerScriptsUseInputActionSystem, SignalBehavior Deferred, UseFixedSimulation and StreamingEnabled are set with it.

  2. Build the input: a Folder Inputs in ReplicatedStorage, an InputContext named CartContext inside it, an InputAction named Drive (Type Bool) inside that, and an InputBinding with KeyCode W inside the action.

    You should see ReplicatedStorage holds a folder Inputs with an InputContext CartContext, an InputAction Drive of Type Bool, and an InputBinding with KeyCode W under it.

  3. Add the docs' InputSetup Script to ServerScriptService: it clones ReplicatedStorage.Inputs into every player on PlayerAdded, and into players already in the game.

    You should see Each player who joins gets a copy of Inputs under their Player object.

  4. Add the CartSim module above to ReplicatedStorage, then a Script in ServerScriptService and a LocalScript in StarterPlayerScripts that each run require(game.ReplicatedStorage.CartSim).Initialize(). Press Play.

    You should see Holding W drives the cart forward and releasing it stops the cart, while the cart stays owned by the server.

  5. Apply the Bad Connection (3G) network preset from Mobile: streaming, memory and draw budgets. Add a LocalScript that calls game:GetService("RunService"):SetPredictionMode(workspace:WaitForChild("Cart"), Enum.PredictionMode.On), drive, then change On to Off and drive again.

    You should see With prediction On the cart answers W at once and sometimes snaps when the server corrects it. With prediction Off it starts and stops a moment after the key, by about the round trip.

Under Server Authority with 3G lag, you set the cart's prediction mode to Off and hold W. What do you see?

  1. The cart starts a moment late, because your client waits for the server's state instead of predicting it
  2. The cart never moves, because only predicted instances read input
  3. The cart moves at once, exactly as with prediction On
  4. The cart moves, but only on your screen
Answer

The cart starts a moment late, because your client waits for the server's state instead of predicting it. The server simulates the cart either way. Prediction lets your client run the same bound function ahead of time, so input feels instant, at the cost of an occasional correction.

Open this step in lesson mode · Link to this step · This confused me

10How studios choose

Your Beacon Yard move check fails once for a player on a mobile connection. What should the server do?

  1. Note it, and act only if it keeps failing over several samples in a row
  2. Kick them immediately
  3. Ban the account
  4. Set their WalkSpeed to 0 for the rest of the session
Answer

Note it, and act only if it keeps failing over several samples in a row. A single failure is often lag. Pull the player back or flag them after repeated failures; punishing on one sample hits honest players on weak networks.

Open this step in lesson mode · Link to this step · This confused me

11Challenges

Level 1, Apprentice

Challenge

Try the Character Controller Library in a scratch place. Do not switch Beacon Yard itself.

Start from
A new Baseplate place in Studio

Done means

  • Avatar Settings is switched to the Character Controller Library
  • You played and compared walking, jumping and climbing a truss with the legacy Humanoid
  • You listed one difference you noticed and one ability you could turn off

Hints

  1. Avatar tab, then Avatar Settings, then the Movement tab.
  2. Play once with each setting and use the same truss.
  3. The abilities list has a checkbox for each default ability.

Level 2, Builder

Challenge

Turn the cart into a server-owned vehicle that trusts only validated, clamped input: finite numbers first, then the clamp.

Start from
The cart from the build-along

Done means

  • The server owns the cart
  • A LocalScript sends throttle and steering through a RemoteEvent at most 20 times a second
  • The server ignores any value that is not a finite number (NaN, infinity or a non-number), then clamps both to -1 to 1 before it sets VectorVelocity and the AlignOrientation goal
  • A forged throttle of 50 moves the cart no faster than a throttle of 1, and a forged NaN leaves the cart as it was

Hints

  1. Send numbers, not positions or velocities.
  2. Check typeof(value) == "number" and value == value and math.abs(value) ~= math.huge first. math.clamp(0/0, -1, 1) is still NaN, so clamping alone does not clean it.
  3. Then math.clamp(throttle, -1, 1) on the server.
  4. Test the forgery from the client command bar by firing the remote with 50, then with 0/0.

In the move check, which walkSpeed should the server pass for a player whose profile has speedOwned = true? Give the Config value.

Answer

24 studs per second. Config.BOOST_SPEED is 24 and Config.WALK_SPEED is 16. Use the same choice applySpeed makes, or honest Speed owners fail the check.

Level 3, Professional

Challenge

Start from the m14-ship tag in the game repo, then fix the stock move check so an honest fall and a little jitter pass while speed hacks and teleports fail. The test uses Config.WALK_SPEED and Config.BOOST_SPEED. Run it with game.ServerScriptService.RunGameTests:Invoke("custom-character-controllers").

Start from
The game at milestone m14 (download)
Grade it
In Studio, press Play, then run game.ServerScriptService.RunGameTests:Invoke("custom-character-controllers") in the server command bar. Copy the pass code from Output.

Done means

  • challenges/work/move_check.luau measures horizontal distance only
  • It allows walkSpeed * dt * 1.25 plus 2 studs of slack
  • It rejects NaN and infinite positions
  • The custom-character-controllers challenge prints TEST PASS for all eight checks

Hints

  1. Build a Vector3 from the X and Z differences with Y set to 0.
  2. A value is NaN when it is not equal to itself.
  3. math.huge and -math.huge are the infinities.

Once the move check passes, which cheat can it still miss?

  1. Moving at exactly the allowed speed, but in a route through walls
  2. Running at 100 studs a second
  3. Teleporting across the yard
  4. Sending a NaN position
Answer

Moving at exactly the allowed speed, but in a route through walls. Distance over time catches speed and teleports. Walking through walls at legal speed needs a different check, such as a raycast between samples, or Server Authority.

Open this step in lesson mode · Link to this step · This confused me

12Recap

Retiring the analogy

You no longer need “your screen and controller at home”. Each player's device runs its own copy of the game for display and input. It owns its character's physics by default, which is why movement feels instant and why a cheater can move strangely.

Recap

  1. By default each client simulates its own character, so movement feels instant and can be cheated; Beacon Yard checks what pays out on the server.
  2. Humanoid, ControllerManager, the Character Controller Library (its docs marked beta, custom abilities renamed in November) and Server Authority are steps from engine-made to fully server-verified movement.
  3. Mover constraints plus network ownership decide whose input moves a part; send input, not positions, to anything the server owns.

The client is your screen and controller at home, until the client also simulates your own character's movement and sends it up, so it is more than a screen.

Next Open Cloud automation: APIs, webhooks, data tools

Open this step in lesson mode · Link to this step · This confused me