As of right now, I don’t really know if I have an answer. I could investigate in an old project of mine that has a functional camera-shifting script.
Edit - Here’s the code I found in that project. You can feel free to use it for the single camera module you want! By the way, it’s set as a LocalScript running inside a StarterGUI instance.
local _Workspace = game:GetService("Workspace")
local workspaceCamera = workspace.CurrentCamera
workspaceCamera.CameraType = Enum.CameraType.Scriptable
local previousCamera = nil
local currentCamera = nil
local CAMERA_VIEW_UPDATE_INTERVAL = 10
local CAMERAS = {
camera_1 = {Position = Vector3.new(157.41, 376.761, 113.038), Orientation = Vector3.new(-15, 60, 0)},
camera_2 = {Position = Vector3.new(-102.48, 405.523, -235.285), Orientation = Vector3.new(-30, 150, 0)},
camera_3 = {Position = Vector3.new(256.692, 392.523, 393.757), Orientation = Vector3.new(-15, -45, 0)},
camera_4 = {Position = Vector3.new(23.407, 405.523, -265.242), Orientation = Vector3.new(-15, -165, 0)},
camera_5 = {Position = Vector3.new(259.52, 405.523, -193.285), Orientation = Vector3.new(-30, 135, 0)},
camera_6 = {Position = Vector3.new(-257.155, 392.523, -130.02), Orientation = Vector3.new(-15, -90, 0)},
}
local function cycleCameraView()
local cameraKeys = {"camera_1", "camera_2", "camera_3", "camera_4", "camera_5", "camera_6"}
-- Summoned on a separate thread
task.spawn(function()
-- Summons a pcall to avoid error swallowing
local success, err = pcall(function()
-- Repeatedly runs the code while the loading is running
while not HAS_LOADING_COMPLETED do
-- Fires a repeat loop to avoid camera mishaps
repeat
local cameraIndex = math.random(1, 6) -- Set as 6 to avoid interval returning as empty
local key = cameraKeys[cameraIndex]
currentCamera = CAMERAS[key]
task.wait()
until currentCamera ~= previousCamera
-- Sets the previous camera
local cameraOrientation = currentCamera.Orientation
previousCamera = currentCamera
workspaceCamera.CFrame = CFrame.new(currentCamera.Position) * CFrame.fromOrientation(
math.rad(cameraOrientation.X),
math.rad(cameraOrientation.Y),
math.rad(cameraOrientation.Z)
)
task.wait(CAMERA_VIEW_UPDATE_INTERVAL)
end
end)
-- Fires a warn if the cycle failed
if not success then
warn("Crash reported on cycleCameraView with err: " ..err)
end
end)
end