Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you block player controller inputs?

Asked by 10 years ago

I want to make some cutscenes in this game using with my own custom animations and some Humanoid methods, but can't find a way to stop the player from constantly controlling the character. I know how to disable all default animations and prevent player from jumping or moving, but i want to block temporarily every player controller input. Is it possible?

1 answer

Log in to vote
0
Answered by
digpoe 65 Badge of Merit
10 years ago

You can remove their controller, which is located in the ControllerService instance. It's not a good idea to destroy it entirely unless you're planning to reconstruct controls entirely, so you could just do something like this:

local cService = game:GetService("ControllerService")

local hCtrl = cService:GetChildren()[1] -- Unless the character is using a skateboard or vehicle, this should be the humanoid controller.

hCtrl.Parent = nil
-- wait until the end of the cutscene
hCtrl.Parent = cService
0
Thanks!! Mattews123 20 — 10y
Ad

Answer this question