The script below is supposed to make the camera when a player spawns focus on an object and rotate, when the script executes, the camera goes crazy, not only rotating, but going back and forth etc, can someone help me please. Thank you.
local target = game.Workspace.CamHead
local camera = game.Workspace.CurrentCamera
camera.CameraSubject = target
camera.CameraType = "Custom"
local angle = 1
while wait() do
camera.CoordinateFrame = CFrame.new(target.Position) --Start at the position of the part
* CFrame.Angles(0, angle, 0) --Rotate by the angle
* CFrame.new(0, 0, 5) --Move the camera backwards 5 units
angle = angle + math.rad(1)
end
|