How to disable Walking/Jumping player without changing WalkSpeed/JumpHeight?

I’m trying to make animations where your character moves, but the player doesn’t have the control of his character, and the only solution i found to this, is change the walkspeed and jumpheight, but in the animation they move. So if i set those values to 0, they will not walk. I hope you can help me a bit.

If you send me a script, tell me how to make it compatible for other platforms. Thanks!

You can Disable Controls For the player using

local Controls = require(game.Players.LocalPlayer.PlayerScripts:WaitForChild("PlayerModule")):GetControls()---GetControls

Controls:Disable() -----Disable Controls

To enable controls simply do:

Controls:Enable()

To my knowledge this works for all platforms!

I used this before but when you reset its permenentaly broken and you cant move anymore, can you help? I did Controls:Disable(false) but it doesnt work.

Did you find a solution for this?

I found a solution for you on a post made by @buildthomas, although I’m not sure how it works on different platforms.

This should work cross-platform but I have not tested it in a while.

Server script or local script and where to put this script

Put this in a Localscript since it gets the LocalPlayer to require the PlayerModule.

I found the solution, I put it in startercharacterscripts instead of starterplayerscripts

I tried this, it worked, but after It runs “Controls:Enable()” and you press one of the walk keys your character stays walking in the direction, and it’s stuck like that, even if you reset.

if the purpose of disable character is for cutscreen or some kind of that then i disable player reset beside movement. otherwise you can make a script detect of character spawn and enabled then

I don’t think it worked anymore, I don’t see :GetControls() in PlayerModule

This is a really useful post! However, Roblox recently introduced an update that changed a few things, causing the original solution in this post to no longer work as expected.

I’m here to provide an updated solution to keep this post relevant and up to date.

In your script, access the PlayerModule ModuleScript at its new location under StarterPlayer. Inside the PlayerModule, navigate to the InputContexts folder and find the CharacterContext InputContext.

To control character movement, simply set the Enabled property of CharacterContext to false to disable movement or true to enable it.