My roblox camera script for my menu abruptly stopped working for no reason, here are the scripts.

Camera script itself:

game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)

local player = game.Players.LocalPlayer
local Camera = workspace.CurrentCamera

repeat wait() until player.Character

Camera.CameraType = "Scriptable"
Camera.CFrame = game.Workspace.Menu.CFrame



The "play" button which starts the game and respawns the character:

local replicatedStorage = game:GetService("ReplicatedStorage")
local respawnEvent = replicatedStorage:WaitForChild("Respawn_Plr") 
local plr = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
	if plr.TeamColor == BrickColor.new("Rust") then
		
    else
	game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true)

	script.Parent.Parent.Enabled = false
	wait(0.5)
	respawnEvent:FireServer()
	workspace.CurrentCamera.CameraType = Enum.CameraType.Custom

end 
end)


The part for the camera is called "Menu" and I don't know why it stopped working, now whenever someone plays the game the camera is stuck in the spawn box (which the menu part isnt at, or meant to be there)

https://prnt.sc/pwlsdw

If someone could help that would be great.

4 comments

0

Imagine using a loop in the place of an event listener. player.CharacterAdded exists, you know...

0

As for your issue, setting the cameratype to custom doesn't change the position of the camera.

0

@AetherProgrammer If you read the first script, I'm changing the camera type to scriptable and CFraming it to a part in the menu called workspace.

0

That's not what I'm talking about. You never set the camera subject back to the humanoid. https://developer.roblox.com/en-us/api-reference/property/Camera/CameraSubject