Frame not showing up when Visible is true

Hello! I am trying to make it so when I press an ImageButton, a Frame becomes visible. I have made the script to do so, but when I press the button the Frame becomes visible, but remains invisible. Does anyone know why this is?

local buildMenu = game.StarterGui.ScreenGui.BuildMenu


local function toggleFrame()
	buildMenu.Visible = true
end


buildButton.MouseButton1Click:Connect(function()
	toggleFrame()
end)
1 Like

Use PlayerGui to define a variable not StarterGui