PlayerModule:GetControls() returns nil. In the old module enabling and disabling the controllers would not lead to anything breaking. What would I exactly do to make it so I can enable and disable the controllers from different localscripts requiring the module without having the bug of not being able to enable it again?
How would you go about enabling the controllers when resetting? It seems to break the controllers sometimes when set to enabled.
You requireâd the ControlModule, not the PlayerModule. The error that you are seeing is because you are trying to perform â:GetControls()â on the literal PlayerModule instance instead of the returned code.
One of my old feature requests about controlscripts has been gaining attention again for some reason (it just reached 100 likes)- any chance this could be considered for the PlayerScripts refactor? Adding a built-in way to let us have the default character controlsâ arrow keys act like WASD (or vice versa) without having to fork would be handy. Certain games use fixed cameras & the arrow keys only let you move up & down in that case, and a default setting to have the camera move with the mouse without having to hold right-click (without being a toggle-able, auto-strafing mode like shiftlock) would also be handy for creators and players alike.
I know this has been brought up, but Tweening the Camera CFrame is still broken when I try to test it in Play Solo⌠Is there a fix Iâm not seeing?
The problem is I need the camera to zoom in on something, but when I try to do that it seems to bounce forward: https://i.gyazo.com/b5305b133f63270f80bd25712187ed16.mp4
It didnât do this before the player scripts update, and I saw in a bunch of threads from about 2 weeks ago that this was supposed to be fixed, has that happened yet? I havenât seen any mention of it, and it seems to work in a real game, but testing it is really annoyingâŚ
Itâs an issue with poppercam as far as I know, it compeltely wrecked a few of my gameâs aspects as well.
So I hope a fix for this will come out very soon.
Like the others above, you are also using require on the ModuleScript in StarterPlayerScripts. Requiring the modules in StarterPlayerScripts is going to start second copies of these controllers running and conflicting with the ones that are already in use (the ones Clone()'d to Players.LocalPlayer.PlayerScripts). Scripts in âStarterâ places like StarterPlayerScripts, StarterCharacterScripts, and StarterGui are not executed, the client always clones scripts from these locations onto your player, and those are the copies that are actually executed.
Just a heads up, since it seems to be a fairly common mistake to makeârequiring modules from StarterPlayerScriptsâand the resulting bugs are difficult to diagnose if you donât know what youâve done wrong, Iâm probably going to add a safeguard against this to the top of each of the player scripts ModuleScripts, something like this:
if script:FindFirstAncestorOfClass("StarterPlayerScripts") ~= nil then
error("Do not require modules directly from StarterPlayerScripts, require the copies cloned under Players.LocalPlayer.PlayerScripts")
return nil
end
We sorted out the require yesterday but the main problem is to re-enable the controllers again as it seems to break. Letâs for instance say that you disable the controllers but then a player kills you and you die. The controllers still will be disabled after respawn. Even if there is a localscript that replicates inside the character each time you spawn in, that enables the movement using the ControlModule:Enable(), it seems to break every so often and still make the player not able to move. This is only fixed once the player rejoins. Would the right thing to do be to require the current controllers from playermodule and then enable it? That seems to also break sometimes.