I am trying to create a smooth isometric camera. With my script, the camera appears very glitchy. I believe that the camera appears glitchy due to the wait()
in the code, however, without waiting, the script crashes the game and I’m not sure of any other solution.
This is my first time working with CFrames and I’m not sure how to make the camera move smoother and I would appreciate it if anyone could point me in the right direction.
My code (Local Script in Starter Player Scripts)
local Camera = game:GetService("Workspace"):WaitForChild("Camera")
local LPlayer = game:GetService("Players").LocalPlayer
wait()
Camera.FieldOfView = 40
Camera.CameraType = Enum.CameraType.Scriptable
while true do
Camera.CFrame = CFrame.new(
-- Position player's camera 15 studs away from their head in each direction
LPlayer.Character:WaitForChild("Head").Position + Vector3.new(15, 15, 15),
-- Point player's camera towards their head
LPlayer.Character:WaitForChild("Head").Position
)
wait()
end
Thanks again!