Camera working wierd

When entering the game the camera is drag to move, When i open the menu you can move your mouse and its visible, when you close it you can’t see it and its locked to center but you cannot click anymore

Menu script:

repeat wait() until game:IsLoaded()

local Menu = script.Parent.CanvasGroup

local Camera = workspace.CurrentCamera

local Input = game:GetService("UserInputService")
Input.MouseIconEnabled = false
Input.MouseBehavior = Enum.MouseBehavior.LockCenter

Input.InputBegan:Connect(function(Key)
	if Key.KeyCode == Enum.KeyCode.M then
		script.Toggle:Play()
		if Menu.GroupTransparency == 1 then
			Menu.GroupTransparency = 0
			Input.MouseIconEnabled = true
			Input.MouseBehavior = Enum.MouseBehavior.Default
		else
			Menu.GroupTransparency = 1
			Input.MouseBehavior = Enum.MouseBehavior.LockCenter			
			Input.MouseIconEnabled = false
		end
	end
end)

Camera settings:
image

Fixed it by making the GUI disabled instead of invisible :expressionless: