Still have questions? Join our Discord server and get real time help.
Log in to vote

How would one make a mobile shiftlock?

Asked by 24 days ago
Edited 24 days ago

Hello I attempted to mimic Roblox's shiftlock so I can apply it to mobile players and it works okay but when I equip a tool my character goes a little crazy, sometimes it feels like it's speeds up and slows down.


local player = game:GetService("Players").LocalPlayer

while not player.Character do wait() end
local humanoidRootPart = player.Character.HumanoidRootPart

local camera = workspace.CurrentCamera

    local offset = (camera.CFrame.p - humanoidRootPart.Position).unit

    humanoidRootPart.CFrame = * CFrame.Angles(0, math.pi / 2 - math.atan2(offset.Z, offset.X), 0)

Second thoughts I think it is due to me changing the HumanoidRootPart's CFrame in a LocalScript. The normal way out would be to use RemoteEvents, correct?? But there would be a slight delay and Roblox's shiftlock does not have a delay so neither do I want it.

Thanks for any help!!

I recently made a tool that was a bit too big for the character to hold, and that sped up the walkspeed in a way, are you sure it isn't because of the design of the tool? SteamG0D 423 — 24d
Well I tested it with a normal part as the handle. I would like to know how to prevent it. GoldAngelInDisguise 176 — 24d
So what the problem for me was that the handle's cancollide was set to true, and it was slightly inside the player's arm. So what you could try is set the tool's parts to cancollide=false and see if that fixes it. SteamG0D 423 — 24d
did not work sorry GoldAngelInDisguise 176 — 24d

Answer this question