Log in to vote

How to fix inconsistent camera CFrame?

Asked by 12 days ago

I am trying to set the camera of the game on a fixed position and rotate around itself. The problem is every time I run the game the camera either ends up in the position I set or some other position which is the same but the y value is a random negative number instead of 10. The rotation works fine but I can’t understand why the script doesn’t work… and yes no other script is changing the camera’s position.

local camera = workspace.CurrentCamera
local plr = game.Players.LocalPlayer

camera.CameraType = Enum.CameraType.Scriptable
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame =,10,0)
    camera.CFrame = camera.CFrame * CFrame.Angles(0,math.rad(1)*dt*60,0)
I saw another post like this. The solution was to add the line plr.Character.ChildAdded("Humanoid"):Wait() before the camera modifying lines. XRed03 17 — 8d
Thank you for helping but this code gives an error... ChildAdded cant be used for a specific instance but I basically used WaitForChild("Humanoid") and it didnt really change iraklisonic354 13 — 8d

Answer this question