Hey there! I have a local script that changes the players camera to a part, and I am trying to make a play button that once clicked, it changes the players camera back to the default one. I have been trying to use Enum.CameraType.Custom. For some reason, I can’t seem to get it to work. I have provided the local script below. It would be amazing if somebody from the community would be able to help me out here. Thank you in advance!
local Player = game.Players.LocalPlayer
local TweenService = game:GetService("TweenService")
local RunService = game:GetService("RunService")
local Camera = game.Workspace.CurrentCamera
local MenuCameras = game.Workspace.MenuCameras
local Mouse = Player:GetMouse()
local StarterGUI = game:GetService("StarterGui")
local AmericaButton = script.Parent.TeamsFrame.America
StarterGUI:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
local AmericaButton = script.Parent.TeamsFrame.America
local UKButton = script.Parent.TeamsFrame.UK
RunService.RenderStepped:Connect(function()
Camera.CFrame = MenuCameras.Camera1.CFrame
end)
AmericaButton.MouseButton1Click:Connect(function()
wait(0.2)
Camera.CameraType = Enum.CameraType.Custom
end)