For mobile shiftlock, you can either fork the module to give yourself the ability of toggling shiftlock, or you can use GameSettings, like this
Also need to set the offset
For mobile shiftlock, you can either fork the module to give yourself the ability of toggling shiftlock, or you can use GameSettings, like this
Also need to set the offset
im gonna bookmark this actually, i didnt know it was that easy
I assume that is a local script, and could you send the complete code for mobile?
Same bruh
30chssssssssssss
That is the complete code, just missing the part where you get the humanoid. What I have left out is stuff specific to my game
And it is a local script
im working on it right now, do you want the shiftlock always active or toggled by a button?
first, we are gonna want to enter the âCameraModuleâ module script and scroll on down to line 521, we are going to to select the end of that line and press enter to create a new line, then we can input the following code:
self.activeCameraController:SetIsMouseLocked(game.Players.LocalPlayer.shiftlock.Value)
next, we are going to create a local script called âmobileShiftlockâ and put it in the âStarterPlayerScriptsâ folder under the âStarterPlayerâ folder. inside this script, paste the following code:
local players = game:GetService("Players")
local shiftlock = Instance.new("BoolValue")
players.PlayerAdded:Connect(function(player)
shiftlock.Parent = player
shiftlock.Name = "shiftlock"
end)
if you want the shiftlock to be constant amongst the mobile players, type this underneath the previous code block:
local userInputService = game:GetService("UserInputService")
if userInputService.TouchEnabled then
shiftlock.Value = true
end
however if you want this to be toggled by a button, create a âScreenGuiâ instance underneath the âStarterGuiâ folder, and then make either a âTextButtonâ or âImageButtonâ (up to your preference) under the âScreenGuiâ and create a local script underneath your button. inside this button input this script:
local players = game:GetService("Players")
local userInputService = game:GetService("UserInputService")
local shiftlock = players.LocalPlayer.shiftlock
if userInputService.TouchEnabled then
script.Parent.Visible = true
else
script.Parent.Visible = false
end
script.Parent.MouseButton1Click:Connect(function()
shiftlock.Value = not shiftlock.Value
end)
feel free to polish up any of the code formatting as i tried to make this as easy as possible to implement, rather than make it visually appealing
i dont have too much time on my hands so i cant fact check these scripts, so if anything breaks please follow up with the given errors!
im heading to bed so ill check in on any replies in the morning, goodnight!
Just now saw this⌠I will give it a try
What is âMouseLockâ meant to be set to? A button?
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.