I am making a custom shift lock, and it works except for moving left and right.
In default shift lock, the player can move left and right without turning their body. But with my shift lock, the player will spin.
What method are you using for rotating the character?
I was able to get pretty close functionality using the code below.
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:wait()
local camera = workspace.CurrentCamera
game:GetService("RunService").RenderStepped:Connect(function()
local pitch, yaw, roll = camera.CFrame:ToEulerAnglesYXZ()
character.HumanoidRootPart.CFrame = CFrame.new(character.HumanoidRootPart.CFrame.p) * CFrame.Angles(0,yaw,0)
end)
thx for your post, i solved it! i realised you were setting the humanoid root part’s cframe to a new cframe instead of using its own cframe, which caused the humanoid root part’s rotation to be fixed.