It worked fine before the update, but now it doesn't work. What do I do to fix it? Before the update it would pan to each of my set locations and rotate the camera as well, but now the camera gets stuck and doesn't move, it only just rotates.
local CameraPanMode = true
local CameraCFrameValues = {}
wait(.1)
for x, item in ipairs(script:WaitForChild("CameraPositions"):GetChildren()) do
CameraCFrameValues[x] = item.Value
end
game.Players.LocalPlayer.Character.Humanoid.Died:Connect(function()
CameraPanMode = false
game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
end)
local SkipGui = Instance.new("ScreenGui", game.Players.LocalPlayer.PlayerGui)
local SkipButton = Instance.new("ImageButton", SkipGui)
SkipButton.Size = UDim2.new(0, 190, 0, 49)
SkipButton.Position = UDim2.new(1, 0, .9, 0)
SkipButton.Image = "rbxassetid://1283904632"
SkipButton.ImageColor3 = Color3.new(0, 0, .7)
SkipButton.BackgroundTransparency = 1
SkipButton.ScaleType = Enum.ScaleType.Slice
SkipButton.SliceCenter = Rect.new(22, 22, 234, 234)
SkipButton:TweenPosition(UDim2.new(1, -158, .9, 0), Enum.EasingDirection.In, Enum.EasingStyle.Quad, 1)
local SkipButtonTextLabel = Instance.new("TextLabel", SkipButton)
SkipButtonTextLabel.Text = "Skip Pan"
SkipButtonTextLabel.Size = UDim2.new(1, 0, 1, 0)
SkipButtonTextLabel.TextColor3 = Color3.new(1, 1, 1)
SkipButtonTextLabel.TextSize = 30
SkipButtonTextLabel.Font = Enum.Font.SourceSansBold
SkipButtonTextLabel.BackgroundTransparency = 1
local SkippedPan = false
SkipButton.MouseButton1Click:Connect(function()
game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
SkippedPan = true
SkipButton:TweenPosition(UDim2.new(1, 0, .9, 0), Enum.EasingDirection.In, Enum.EasingStyle.Quad, 1)
ShowGuisAgain()
end)
script.SkipPan.Event:Connect(function()
game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
SkippedPan = true
SkipButton:TweenPosition(UDim2.new(1, 0, .9, 0), Enum.EasingDirection.In, Enum.EasingStyle.Quad, 1)
ShowGuisAgain()
end)
local PriorGuiVisiblity = {}
local HideGuisConnection
spawn(function()
for key, value in ipairs(game.Players.LocalPlayer.PlayerGui:GetChildren()) do
if value ~= SkipGui and value.Name ~= "LoadingGui" then
if value:IsA("ScreenGui") then
PriorGuiVisiblity[value] = value.Enabled
value.Enabled = false
end
end
end
HideGuisConnection = game.Players.LocalPlayer.PlayerGui.ChildAdded:Connect(function(item)
if item:IsA("ScreenGui") then
PriorGuiVisiblity[item] = item.Enabled
item.Enabled = false
end
end)
end)
function ShowGuisAgain()
HideGuisConnection:Disconnect()
for key, value in pairs(PriorGuiVisiblity) do
if value then
key.Enabled = value
end
end
end
game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
game.Workspace.CurrentCamera.CFrame = CameraCFrameValues[1]
for x = 2, #CameraCFrameValues do
if SkippedPan then
break
end
game.Workspace.CurrentCamera:Interpolate(CameraCFrameValues[x], CameraCFrameValues[x] * CFrame.new(2, 2, -10), 4)
wait(4)
end
if not SkippedPan then
wait(5)
end
ShowGuisAgain()
game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
CameraPanMode = false
SkipButton:TweenPosition(UDim2.new(1, 0, .9, 0), Enum.EasingDirection.In, Enum.EasingStyle.Quad, 1)
wait(1)
SkipGui:Destroy()

2 comments
what do you mean "it doesn't work". You need to be more descriptive about your issue. I suggest you add function calls to print in the functions, and if they print, the code is executing.
Before the update it would pan to each of my set locations and rotate the camera as well, but now the camera gets stuck and doesn't move, it only just rotates.