Character keeps spinning with custom camera

Here is my script:
Cam = workspace.CurrentCamera
RunService = game:GetService(“RunService”)
RenderStep = RunService.RenderStepped

RunService.RenderStepped:Connect(function()
Cam.CFrame = script.Parent.HumanoidRootPart.CFrame
end)
Whenever I press “S” to go backwards, the character will spin around instead of walking backwards.
Why is this happening?

The problem is that Roblox uses a Z-up coordinate system:

https://en.wikipedia.org/wiki/Z-up
https://en.wikipedia.org/wiki/Y-up

So when you move the camera’s CFrame, it will rotate if the Y value doesn’t match the character’s Y value.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.