You can write your topic however you want, but you need to answer these questions:
I want my Humanoid Root Part to face the direction of my camera to imitate a shift lock effect
The issue is that it works fine on a Local Script, but when looked at from a server or from another player the player is glitching around and looking at different directions(Shown in the video). The effect is most present when the player is walking backwards but it also affects the player overall, this causes issues because when creating things like throwable objects the HRP is facing a different direction then the player is actually looking at, this might be a issue where the server just doesn’t know what direction the hrp is, if so then what are the solutions?
All the solutions I have tried are in the code block
-- Old Code
local dir = Vector3.new(camLook.X, 0, camLook.Z).Unit
if not char:HasTag("Ragdolled") then -- Ignore This
hrp.CFrame = CFrame.new(hrp.Position, hrp.Position + dir)
end
-- New Code but has the same effect
local dir = fakeCam.CFrame.LookVector
if not char:HasTag("Ragdolled") then
hrp.CFrame = CFrame.new(hrp.Position, hrp.Position + dir)
end
local lookVector = camCF.LookVector
local flatLookVector = Vector3.new(lookVector.X, 0, lookVector.Z).Unit
pos = CFrame.new(head.Position, head.Position + flatLookVector)
pos = pos * CFrame.new(2, 0, 0)
springAnimModule.target(fakeCam, 5, 30, {CFrame = pos + bobble/2})
local dir = fakeCam.CFrame.LookVector
if not char:HasTag("Ragdolled") then
local targCFrame = CFrame.new(hrp.Position, hrp.Position + dir)
hrp.CFrame = hrp.CFrame:Lerp(targCFrame , 0.3)
end
Also it can be mouse and body cannot compare so if body follows the Cursor it moves sideway *because screen’s center is arrow *cuz you shift lock and body’s position Left side of center so it can be cause the problem. My suggestion you can add keybind which is can’t follow the body if player goes backward. no if player not pushing Backward mouse can follow the body.
The solution was really simple lol, the code wasent at fault all I had to do was set hum.AutoRotate to false and then re-enable it when the player is not shift locking. Thanks for the help