Camera CFrame wont change

Greetings! I am building a cutscene kind of thing. It includes setting the camera’s CFrame to look at a door.

I am currently using a remote event going from a server script to a local script (located in StarterGUI; serverscript is in SSS). The local script contains code to change the CurrentCamera’s CFrame to a part’s CFrame. The server script just fires the remote event.

Local Script:

local event = game:GetService("ReplicatedStorage"):WaitForChild("camEvent")

local cam = workspace.CurrentCamera

local camPart = workspace:WaitForChild("campart")

event.OnClientEvent:Connect(function()
	cam.CameraType = Enum.CameraType.Scriptable
	
	wait(36)

	cam.CFrame = camPart.CFrame
end)

ServerScript:

local ts = game:GetService("TweenService")

local door1 = workspace:WaitForChild("door1")
local door2 = workspace:WaitForChild("door2")

local event = game:GetService("ReplicatedStorage"):WaitForChild("camEvent")

local camera = workspace.Camera

local platform = workspace:WaitForChild("PlatformElevator")

local event1 = door1:WaitForChild("Event")
local event2 = door2:WaitForChild("Event")

game.Players.PlayerAdded:Connect(function()
	wait(1)
	event:FireClient(player)
	wait(5)
	event1:Fire()
	event2:Fire()
	
	wait(12)
	
	ts:Create(platform, TweenInfo.new(5), {Position = Vector3.new(224, 4.75, 264)}):Play()
	wait(9)
	ts:Create(platform, TweenInfo.new(5), {Position = Vector3.new(224, -5.75, 264)}):Play()
end)

No errors.

the variable, player, is not defined in the script

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.