Lets say I have code like this :
repeat wait() until game.Players.LocalPlayer.Character local Player = game.Players.LocalPlayer local camera = workspace.CurrentCamera while wait() do camera.CFrame = camera.CFrame * CFrame.Angles(0,math.rad(45),0) end
The problem with this is that the camera just keeps rotating. I want to find a way to be able to SET the rotation of the camera.
This doesn't work either :
while wait() do camera.CFrame = CFrame.Angles(0,math.rad(45),0) end
I'm not sure how to set the rotation itself. to make it point to a specific degree while it's in a loop. Does anyone know how to SET it in a loop?
I'm not to sure on what you're trying to achieve, if you are trying to rotate the camera so its constantly looking at a part, refer to:
Setup: Place a part in which you want the camera to constantly look at
while wait() do local camera = workspace.CurrentCamera local pos = CFrame.new(x,y,z) --The position of the part local lookAt = part.Position --What position/part its looking at pos = Vector3.new(pos.X, pos.Y, pos.Z) camera.CFrame = CFrame.new(pos, lookat). end
This will allow you to alter the degree in which it looks at so you don't have to manually alter the degree in the script.