Controls automatically enabled when switching input type

Hey there.
I am having an issue when it comes to disabling a players controls inside of a game. If the player changes input types, for example using an Xbox remote, the players controls are automatically enabled. This means that if I disable the controls, a player can bypass it and thus break many things in my game such as NPC interaction.

I am using the way Roblox provided here: New Player Scripts are coming (10.11.18), and how you can prepare - #16 by AllYourBlox

Here is a basic script of it:

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

Controls:Disable()

If you have a PC and an Xbox controller, then you can test it out yourself in this Roblox Studio file:
Controls Toggle - Testing Baseplate.rbxl (38.0 KB)

You can also try it in this Roblox game:

Here is a video of me testing it out: (walking into the blue part disables the players controls.)

2 Likes

Following up!

The issue should be fixed now. Can you confirm @Reditect?

Thank you!

1 Like

Hey, I am no longer having the issue in games, but still have the issue in Studio.

Here is an image of my studio version:
image
(0.526.0.5260426)

My apologies, I turned it on a bit early. The change should be out with version 527. Can you update and check again?

2 Likes

Heyo, sorry for the somewhat late reply. I updated and the bug seems to no longer be an issue. Thanks for all the help. :slight_smile:

1 Like

This topic was automatically closed after 2 days. New replies are no longer allowed.