Issue with disabling player controls

Good day Developers,

I am currently creating a cutscene and therefore I had to disable player controls. However, the issue is that in the studio it works fine but if I play the game it doesn’t work anymore.

This is the code…


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

local playercontrols = PlayerModule:GetControls()

playercontrols:Disable()

game.ReplicatedStorage.Controls.OnClientEvent:Connect(function()
	print("Touched")
	playercontrols:Enable()
end)

May someone help with this? I tried using the walkspeed method but the player can still jump. Thank you in advane!

Did you check the Developer Console? And did you publish the game?

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

Your stating you tried the WalkSpeed method and they could still jump, but you could also change the JumpHeight right?

1 Like

I agree. But if your game is available for mobile I reccommend disabling ModalEnabled while cutscene

2 Likes

Hello,

Thank you for answering! Yes, I’ve published the game and I checked to be sure with the print event. According to the developer console, this message is showing up:
“Player:Move called, but player currently has no humanoid.”.

Oh, great idea! I’m pretty sure this should be better, thank you! Especially it’s only for one cutscence.

Didn’t worked but thank you for answering!