I have a fixed camera and I want to make it so when you switch rooms the camera switches over to that room. Ive tried over 7 different scripts and none of them are working so im here to ask for help.

Heres the camera script you get when you spawn

local Player = game.Players.LocalPlayer
local Character = Player.Character
local Player_Torso = Character.UpperTorso

-------------------------------------------------------------------

local Cam = workspace.CurrentCamera
local Camera1 = game.Workspace.Cameras.Camera1

-------------------------------------------------------------------

Cam.CameraType = Enum.CameraType.Scriptable
Cam.CameraSubject = Camera1

-------------------------------------------------------------------

game:GetService("RunService").RenderStepped:connect(function()
	if Player.Character and Player.Character:FindFirstChild('Humanoid') then
		Cam.CoordinateFrame = CFrame.new(Camera1.Position)
	end
end)

-------------------------------------------------------------------

And when you touch the part the camera is supposed to move and heres the script for that

local Player = game.Players.LocalPlayer
local Character = Player.Character

-------------------------------------------------------------------

local Cam = workspace.CurrentCamera
local Camera2 = game.Workspace.Cameras.Camera2

-------------------------------------------------------------------

Cam.CameraType = Enum.CameraType.Scriptable
Cam.CameraSubject = Camera2

-------------------------------------------------------------------
if Player.Character and Player.Character:FindFirstChild('Humanoid') and game.Workspace.Cameras.Camera2Trigger.Touched:connect(function()
	Cam.CoordinateFrame = CFrame.new(Camera2.Position)
end

-------------------------------------------------------------------

I am so lost why they arent working like honestly.

2 comments

0

Any errors?

0

No none at all