At the time of writing this, I've been having trouble for the past few days with getting this camera manipulation script to not only work in studio mode, but also in the actual game. Here is my code:
Localscript:
local target = workspace.MadHotel.MapCutscene.Point2
local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Attach
camera.CameraSubject = target
local angle = 0
target = workspace.MadHotel.MapCutscene.Point2
i = 0
while i < 55 do
camera.CoordinateFrame = CFrame.new(target.Position) --Start at the position of the part
* CFrame.Angles(0, angle, 0) --Rotate by the angle
* CFrame.new(0, 0, 0) --Move the camera backwards 5 units
angle = angle + math.rad(0.75)
i = i+1
wait(0.01)
end
target = workspace.MadHotel.MapCutscene.Point3
i = 0
while i < 55 do
camera.CoordinateFrame = CFrame.new(target.Position) --Start at the position of the part
* CFrame.Angles(0, angle, 0) --Rotate by the angle
* CFrame.new(0, 0, 0) --Move the camera backwards 5 units
angle = angle + math.rad(0.75)
i = i+1
wait(0.01)
end
target = workspace.MadHotel.MapCutscene.Point4
i = 0
while i < 55 do
camera.CoordinateFrame = CFrame.new(target.Position) --Start at the position of the part
* CFrame.Angles(0, angle, 0) --Rotate by the angle
* CFrame.new(0, 0, 0) --Move the camera backwards 5 units
angle = angle + math.rad(0.75)
i = i+1
wait(0.01)
end
target = workspace.MadHotel.MapCutscene.Point5
i = 0
while i < 55 do
camera.CoordinateFrame = CFrame.new(target.Position) --Start at the position of the part
* CFrame.Angles(0, angle, 0) --Rotate by the angle
* CFrame.new(0, 0, 0) --Move the camera backwards 5 units
angle = angle + math.rad(0.75)
i = i+1
wait(0.01)
end
target = workspace.MadHotel.MapCutscene.Point2
i = 0
while i < 55 do
camera.CoordinateFrame = CFrame.new(target.Position) --Start at the position of the part
* CFrame.Angles(0, angle, 0) --Rotate by the angle
* CFrame.new(0, 0, 0) --Move the camera backwards 5 units
angle = angle + math.rad(0.75)
i = i+1
wait(0.01)
end
target = workspace.MadHotel.MapCutscene.Point3
i = 0
while i < 55 do
camera.CoordinateFrame = CFrame.new(target.Position) --Start at the position of the part
* CFrame.Angles(0, angle, 0) --Rotate by the angle
* CFrame.new(0, 0, 0) --Move the camera backwards 5 units
angle = angle + math.rad(0.75)
i = i+1
wait(0.01)
end
target = workspace.MadHotel.MapCutscene.Point4
i = 0
while i < 55 do
camera.CoordinateFrame = CFrame.new(target.Position) --Start at the position of the part
* CFrame.Angles(0, angle, 0) --Rotate by the angle
* CFrame.new(0, 0, 0) --Move the camera backwards 5 units
angle = angle + math.rad(0.75)
i = i+1
wait(0.01)
end
target = workspace.MadHotel.MapCutscene.Point5
i = 0
while i < 55 do
camera.CoordinateFrame = CFrame.new(target.Position) --Start at the position of the part
* CFrame.Angles(0, angle, 0) --Rotate by the angle
* CFrame.new(0, 0, 0) --Move the camera backwards 5 units
angle = angle + math.rad(0.75)
i = i+1
wait(0.01)
end
What the code is supposed to do is circle the camera around different parts of the level after certain periods of time, sort of like a quick overview of the level.
I tried putting the main code into a while true loop, copying to each player with a script rather than putting it in startergui, and I have no clue why each time it will work perfectly in Roblox Studio, but not in the actual game. Could someone please help me find a solution to this issue?

2 comments
Sounds silly, but try making the CameraType Scriptable.
I'm not sure if you can set the CFrame of the camera without setting it to scriptable either, but if it works in studio I assume you can.