Okay, last days I've been experimenting with camera manipulation and so, I've successfully developed a GUI in where when you press the TextButton with a name, the LocalScript will search in ReplicatedStorage for a folder named Cameras, in which, it should have a Camera with the same name of the TextButton. And then, the script should change the CameraType to "Scripted" and clone the CoordinateFrame, Focus and FieldOfView from the original camera to the CurrentCamera.
After that, the player can close the gui and so, it will return to the normal camera.
My big problem is: It works on Studio Solo, but not in Online mode! I've already tried everything, since waiting until a plr.Character is not equal to nil, to disabling the entire FilteringEnabled system!
I will not post the entire script here, instead, I will make a short resume.
repeat wait() until game.Players.LocalPlayer.Character wait(1) local plr = game.Players.LocalPlayer local curcam = game.Workspace.CurrentCamera local monitor = false local button = script.Parent:FindFirstChild("Toggle") local cameras = game.ReplicatedStorage:FindFirstChild("Cameras") local gui = script.Parent:FindFirstChild("MonitorScheme") local choices = gui:FindFirstChild("Choices") local currentCamera = nil local lastCamera = choices.MainCorridor function changeCamera(node) if lastCamera == node then return end if node and cameras:FindFirstChild(node.Name) then lastCamera = node currentCamera = node ccam = cameras:FindFirstChild(node.Name) curcam.CameraType = "Scriptable" curcam.CoordinateFrame = ccam.CoordinateFrame curcam.Focus = ccam.Focus end end function onToggled() if not monitor then monitor = true gui.Visible = true changeCamera(lastCamera) else monitor = false gui.Visible = false currentCamera = nil curcam.CameraType = "Custom" curcam.CameraSubject = plr.Character:FindFirstChild("Humanoid") curcam.FieldOfView = 70 end end function init() for _, c in pairs(choices:GetChildren()) do if c:IsA("TextButton") then c.MouseButton1Down:connect(c) end end end init()
Please don't mind any syntax errors. As I said before, this is a resume and is not meant to work. It's just to showcase the script. But, this example and the original script won't work, only the gui will show up, the cameras won't change but the variables do. No errors printed in the output.