How do I re-enable controls?

I used the following method to disable movement, but now I cant re-enable it.

local controls = require(game:GetService("Players").LocalPlayer.PlayerScripts.PlayerModule):GetControls()

controls:Disable()

When I tried the following method, it did nothing.

controls:Enable()

How do I re-enable controls?

local controls = require(game:GetService("Players").LocalPlayer.PlayerScripts.PlayerModule):GetControls()

Probably by re-requiring the module.

Try

controls:Enable(true)

Hi! You can just do…

local cas = game:GetService("ContextActionService")
cas:BindActionAtPriority("DisableControls",function()
return Enum.ContextActionResult.Sink
end,false,Enum.ContextActionPriority.High.Value, unpack(Enum.PlayerActions:GetEnumItems()))

Then unbind the action when you want to re-enable the controls.

cas:UnbindAction("DisableControls")

Just a side-solution I don’t know the answer to your question.

1 Like

You need to recall local controls = require(game:GetService("Players").LocalPlayer.PlayerScripts.PlayerModule):GetControls() on characterAdded event.

For some reason, the controls module completely destroys itself when the character respawns.