I Am trying to make a top down camera script. So I Asked a question earlier today asking why my script wasn't working, I got a reply with an edited one that did work, however when i try to make a small adjustment to the distance from the player or the angle the camera is facing the player at, it makes the camera all wonky and It doesn't work properly then. Script:
game:GetService("ControllerService"):ClearAllChildren() repeat wait() until game.Players.LocalPlayer.Character local char = game.Players.LocalPlayer.Character local cam = game.Workspace.CurrentCamera cam.CameraType = Enum.CameraType.Scriptable cam.FieldOfView = 70 spawn(function() while true do game:GetService("RunService").RenderStepped:wait() local pose = char.HumanoidRootPart.Position + Vector3.new(5, 10, -5) local lookAt = char.HumanoidRootPart.Position cam.CFrame = CFrame.new(pose , lookAt) * CFrame.Angles(0,0,0)-- Please note that the Angles part is for after the script works so I can adjust it then. end end)
I want an angle at 45 degrees so for that the:
CFrame.Angles(0,0,0) -- line 13
Would need to be:
CFrame.Angles(45,0,0) -- line 13
but when i do that, it makes it all wonky, its the same if i want to make it 15 studs away from the character here:
Vector3.new(5, 10, -5) -- line 11
Any fixes are welcome. Please ask for any more information, and no, there is not a error message.
CFrames.Angles uses radians, so to convert degrees into radians use math.rad EX:
CFrame.Angles(math.rad(45),0,0) -- converted degrees into radians