How to do I disable player movement without setting there walk speed?

I tried

local playerModule = require(game:GetService("Players").LocalPlayer.PlayerScripts:WaitForChild("PlayerModule"))

local controls = playerModule:GetControls()

controls:Disable()

but it did not work

2 Likes

You can anchor the HumanoidRootPart.

but the player would float if you anchor it while its falling?

1 Like

You can use ContextActionService to disable the necessary inputs, which includes mobile and console movement:

3 Likes

Yes, but u could wait for the player to fall, have it anchor when it touches ground or set a spawnpoint

I can’t have it anchored, I need to be able to run animations

Unanchor after whatever u need them momentarily stopped for

They need to be stopped the whole game, it is confusing but

As long as you anchor just the HRP, animations will still look natural, anchoring the torso is what makes it look unnatural.

You can also try raycasting sometimes to teleport the character to ground level if needed.

There is a setting on the client that you can disable character controls but still run animations. The last line in that code is to disable player chat too if you wanted to do that.

local controls = require(game:GetService("Players").LocalPlayer.PlayerScripts.PlayerModule):GetControls()
        controls:Disable()
        StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, false)

Then to reenable the controls + chat do:

        controls:Enable()
        StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, true)
1 Like

local ins = Instance.new(“BodyVelocity”)
ins.Parent = player.HumanoidRootPart
ins.MaxForce = Vector3.new(4000000000, 0, 400000000)
ins.Velocity = Vector3.new(0, 0, 0)

1 Like

PlayerModule does not exist apparently