Whenever I try to rotate the camera around a part, the camera starts to shake/stutter near the end of the rotation. Any ideas why?
local Part = workspace.Part
local UIS = game:GetService('UserInputService')
local Camera = workspace.CurrentCamera
local newY = 0
local currentY = 0
local isTurning = false
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CameraSubject = Part
game:GetService('RunService').RenderStepped:connect(function()
Camera.CoordinateFrame = CFrame.new(Part.Position)
* CFrame.Angles(0, currentY, 0)
* CFrame.new(0, 0, 10)
if currentY < newY then
currentY = currentY + math.rad(1.5)
elseif currentY > newY then
currentY = currentY - math.rad(1.5)
end
end)
UIS.InputBegan:connect(function(input)
if input.KeyCode == Enum.KeyCode.Q then
newY = newY + math.rad(90)
elseif input.KeyCode == Enum.KeyCode.E then
newY = newY - math.rad(90)
end
end)
