I rotate the player when they dodge based on the Camera’s LookVector. However, when I set the CFrame it also makes the player touch the ground again. So if the player was jumping it would create this weird glitch. And if the player is walking then it moves the player back a little.
Here’s the Video:
Local Script:
local camera = workspace.CurrentCamera
local lookCam = camera.CFrame.LookVector
local runService = game:GetService("RunService")
runService.RenderStepped:Connect(function ()
lookCam = camera.CFrame.LookVector
end)
Server Script:
hrp.CFrame = CFrame.new(hrp.Position, Vector3.new(lookcam.X * 9999, hrp.Position.Y, lookcam.Z * 9999))
I also have a remote that sends the info to the server. I just need to make the rotation smoother and if the player is mid-air not to make them go back to the ground.