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!

13 Likes

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!

46 Likes

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.

5 Likes

Did you find a solution for this?

1 Like

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

2 Likes

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

2 Likes

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

1 Like

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.

1 Like