Disabling player controls should be less complicated and more unified

As a Roblox developer, it is currently too hard to “truly” turn off all player controls.

The Problem

In order to remove ALL player controls, you must:

  • Call PlayerModule:Disable() - to turn off movement controls
  • Call StarterGuiService:SetCore(“ResetButtonCallback”, false) - to turn off resetting
  • Toggle DevEnableMouseLock - to turn off “Shift Lock Switch”
  • Turn off “AutoRotate” in a player’s humanoid - to turn off spinning if a player were to go in first person (but this may be undesired if you wish to move the player in a cutscene)
  • Depending on the device, unbind (or use booleans) for various ContextActionService actions + listeners

Use Cases

Problem One - Not Knowing the Above

This will sound somewhat sarcastic, but I mean it genuinely. The first problem with disabling player controls is even knowing all of the above options exist and can be utilized.

Problem Two - Knowing the Above, It’s Still Tedious

Even if you know all of the options to turn off player controls, it’s still tedious. You have to tap into 4-5 different areas where player controls exist. This is neither streamlined nor straightforward. New developers must have one heck of a time.

Problem Three - Pcalls and Future-Proofing…

Even if you perform all of these tasks, there is no guarantee they will all succeed. Pcalling and retrying is the solution, but a player may be able to slightly move their character during those failed frame(s).

In addition, all of these workflows are rather scattered. It does not feel future-proof. If Roblox ever changes the default location for these control sources, your approach will be broken.

The Solution

Add a centralized spot for toggling player controls off (perhaps a single property on the Players instance?).

Having granular ways to toggle off player controls is greatly appreciated, but the way to turn OFF everything is incredibly hard to discover + is not user-friendly.

If this issue is addressed, it would improve my development experience because I will be able to more easily turn off player controls and have control over my experience.

26 Likes

:red_circle: I totally agree with this, I am currently using ContextActionService to override the controls. Yet! Mobile players can press their jump button which doesn’t remove at all from the screen and all controls will be gained back. They can just move around in my game lobby after pressing the jump button.

  • As you mentioned, some of the solutions you showed can fail. I have experienced issues with disabling controls via the PlayerModule, the function Disable needs to be called around 2 times because it just doesn’t disable the controls sometimes, same with Enable.

  • SetCore() literally errors if is not loaded yet, making us retry with pcall in a loop until it’s successful.

:green_circle: A property on the player as you mentioned, something like Player.ControlsEnabled would be very useful instead of all those hacky ways to disable them. Is literally a pain to disable controls currently…

5 Likes