When the camera is set to scriptable mode, tweens “click” into place, which is very janky if the result should be smooth:
At the end of each tween, observe the sudden shift in the orientation of the camera.
Repo: Camera Clicks into position Repo File.rbxl (55.3 KB)
--!strict
if not game:IsLoaded() then
game.Loaded:Wait()
end
while true do
print("Camera scriptable = true")
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
print("Tweening close")
local CameraTween = game.TweenService:Create(
workspace.CurrentCamera,
TweenInfo.new(2, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut),
{CFrame = CFrame.new(0, 5, 0, 0.05, -1, 0.15, 0, 0.15, 1, -1, -0.05, 0)
}
)
CameraTween:Play()
CameraTween.Completed:Wait()
print("TweenEnded close")
task.wait(1)
print("Tweening far")
local CameraTween = game.TweenService:Create(
workspace.CurrentCamera,
TweenInfo.new(2, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut),
{CFrame = CFrame.new(0, 1663, 0, 0.05, -1, 0.15, 0, 0.15, 1, -1, -0.05, 0)
}
)
CameraTween:Play()
CameraTween.Completed:Wait()
print("TweenEnded far")
task.wait(1)
print("Camera scriptable = false")
workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
task.wait(1)
end
Expected behavior
Camera smoothly interpolates into place, without “clicking”.