You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
Im making my own shift lock with more smooth turns.
What is the issue? Include screenshots / videos if possible!
The code im using turns my character in the y axis, but i dont want that.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I Tried using CFrame.Angles, LookVector, LookAt, but im not good at maths to make it work.
Basically, you change player’s angle to every angle of camera rotation but the Y axis, and keep it the same.
(i could have made a mistake since i rarely use rotation parameter of cframe)
wait()
local Ang = CFrame.Angles
local aSin = math.asin
local aTan = math.atan
local Cam = game.Workspace.CurrentCamera
local Plr = game.Players.LocalPlayer
local Mouse = Plr:GetMouse()
local Body = Plr.Character or Plr.CharacterAdded:wait()
local Head = Body:WaitForChild("Head")
local Hum = Body:WaitForChild("Humanoid")
local Core = Body:WaitForChild("HumanoidRootPart")
local IsR6 = (Hum.RigType.Value==0) --[Checking if the player is using R15 or R6.]
local Trso = (IsR6 and Body:WaitForChild("Torso")) or Body:WaitForChild("UpperTorso")
local Neck = (IsR6 and Trso:WaitForChild("Neck")) or Head:WaitForChild("Neck") --[Once we know the Rig, we know what to find.]
local Waist = (not IsR6 and Trso:WaitForChild("Waist")) --[R6 doesn't have a waist joint, unfortunately.]
local UpdateSpeed = 3
Neck.MaxVelocity = 1/3
Hum.AutoRotate = false
game:GetService("RunService").RenderStepped:Connect(function()
Core.CFrame = Core.CFrame:lerp(CFrame.new(Core.Position, Vector3.new(Mouse.Hit.p.x, Core.Position.Y, Mouse.Hit.p.z)), UpdateSpeed / 2)
end)