How to disable player character's movement?

Hello everyone,

I’ve been making a game where the player’s character doesn’t need to move at all. However, even after trying to remove the humanoid (this broke the character), anchor the entire thing (didn’t work except on the client), or unbind all actions (didn’t unbind the movement actions), the character still is controllable.

How can I make it so that the character can’t move at all? Thanks for your time.

NOTES:

  • i still want the character model itself, but really don’t need the humanoid (can always use an animation controller if animations are needed)
1 Like

Set the humanoid’s WalkSpeed to 0 for the characters to stop moving completely.

Example:

local humanoid = character:WaitForChild("Humanoid")

humanoid.WalkSpeed = 0
humanoid.JumpPower = 0

You can also anchor the HumanoidRootPart for characters to stop moving as well.

Another example:

character:WaitForChild("HumanoidRootPart").Anchored = true
1 Like

Humanoid.WalkSpeed = 0
Humanoid.JumpPower = 0

but can’t the player just change the walkspeed back to 16 if they wanted to?

only if you have a sprint script or if they have acces to a console

all the replies are great but you can also anchor the humanoidrootpart

player.Character:WaitForChild("HumanoidRootPart").Anchored = true

1 Like

But I’m pretty sure the joystick would be visible on mobile then.

The client has network ownership over their own character models so they can essentially do whatever they like, hence you could perform server-side checks if necessary.

all the replies are great but you can also disable it

local playerscripts = player.PlayerScripts
local playermodule = require(playerscripts:WaitForChild("PlayerModule"))
local controls = playermodule:GetControls()
controls:Disable()
15 Likes