How do i edit my Camera Script Without it tilting?
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:
01 | game:GetService( "ControllerService" ):ClearAllChildren() |
03 | repeat wait() until game.Players.LocalPlayer.Character |
04 | local char = game.Players.LocalPlayer.Character |
05 | local cam = game.Workspace.CurrentCamera |
07 | cam.CameraType = Enum.CameraType.Scriptable |
12 | game:GetService( "RunService" ).RenderStepped:wait() |
13 | local pose = char.HumanoidRootPart.Position + Vector 3. new( 5 , 10 , - 5 ) |
14 | local lookAt = char.HumanoidRootPart.Position |
15 | cam.CFrame = CFrame.new(pose , lookAt) * CFrame.Angles( 0 , 0 , 0 ) |
I want an angle at 45 degrees so for that the:
Would need to be:
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:
Any fixes are welcome.
Please ask for any more information, and no, there is not a error message.