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 game:GetService("RunService").RenderStepped:Connect(function() local offset = (camera.CFrame.p - humanoidRootPart.Position).unit humanoidRootPart.CFrame = CFrame.new(humanoidRootPart.Position) * CFrame.Angles(0, math.pi / 2 - math.atan2(offset.Z, offset.X), 0) end)
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!!