UI Buttons don't respond

Hey there!
I’m currently cooking on an update for my game. Whilst doing that I found a bug that requires fixing.
Basically whats happening is:

  1. I join the game. The UIs work.
  2. I go to the next area in the game (same place). The transition is a black frame (zindex > 10000) that gets destroyed after the next area has been reached.
  3. After the player arrives in the next area, the uis break.

Does anyone know why this is happening? I’ll add some footage below.

1 Like

This most likely has something to do with your code, of which I ask you provide the code for your UI. Thanks :D

5 Likes

I second this, we cannot help without actually seeing your code. Most likely you’re destroying more frames than you need to in some way, or the connections for buttons are being broken.

2 Likes

You loading the character?

It sounds like an issue with the ResetOnSpawn property.

2 Likes

interesting!

seems like the buttons that WEREN’T covered by the transition frame still work. but yes, like others have said, we are going to need to see the script.

maybe it isn’t getting destroyed (somehow), only becoming transparent.

1 Like

Sorry, which scripts to do you need? I’m assuming the transition one in which case:

local function GetPlayerToMines()
		local Gui = Instance.new("ScreenGui", plr.PlayerGui)
		local Frame = Instance.new("Frame", Gui)
		Frame.Size = UDim2.new(1,0,1,0)
		Gui.DisplayOrder = 9999999999
		Gui.IgnoreGuiInset = true
		Frame.BackgroundColor3 = Color3.new(0,0,0)
		Frame.Transparency = 1
		local Label = Instance.new("TextLabel")
		Label.Font = Enum.Font.FredokaOne
		Label.TextScaled = true
		Label.Text = "Loading..."
		Label.TextColor3 = Color3.new(1, 1, 1)
		Label.BackgroundTransparency = 1
		Label.Size = UDim2.new(0.2, 0, 0.1, 0)
		Label.Position = UDim2.new(0.4, 0, 0.45, 0)
		local Tween = TweenService:Create(Frame, TweenInfo.new(TRANSITION_TWEEN_TIME, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {Transparency = 0})
		Tween:Play()
		Debris:AddItem(Tween, TRANSITION_TWEEN_TIME+0.1)
		Tween.Completed:Wait()
		Label.Parent = Frame
		
		GiveAdjustedTools()
		repeat task.wait() Label.Rotation += 1 until LoadMinesHud() == "Done" and DeleteServerOnlyWalls() == "Done" and TeleportPlayerToMines() == "Done"
		
		Label:Destroy()
		local Tween = TweenService:Create(Frame, TweenInfo.new(TRANSITION_TWEEN_TIME, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {Transparency = 1})
		Tween:Play()
		Debris:AddItem(Tween, TRANSITION_TWEEN_TIME+0.1)
		Debris:AddItem(Gui, TRANSITION_TWEEN_TIME+0.1)
end

this should be the relevant code

also i dont think it has anything to do with the ResetOnSpawn property, since in my game the players only spawn once and CANT die

Also, this is the hierarchy of the gui (its called topbar because it used to be at the top):
image

The objects in the green frame work. Those in the red frame are all structured the same way and dont work. Incase you wanna know why there are more GUIs in a GUI: I dont really know. I made this back when I was a rookie-rookie and I used the :GetPropertyChangedSignal(“Enabled”) on one of the lower GUIs for animation purposes

Ah gotcha.

Well… since all those buttons are showing the rest of the UI, it’s still possible the ones circled in red also don’t work.

Actually, what does TeleportPlayerToMines() do?

Yes, it teleports you to the mines, but what’s the code?

to be exact

local function TeleportPlayerToMines()
		local Character = plr.Character
		Character:PivotTo(MinesEntryTeleportPart.CFrame)
		return "Done"
	end

nothing UI related. Also I gotta go sleep now I’ve got work tomorrow. Sorry, but I’ll have to leave you all on read for a while :sob:

HI @Vinnie24_YT

List of potential errors:

  • Frame already exsist and you are just overwrtiting its property ( This is very unlkely):

  • GiveAdjustedTools() maybe cause problem i cannot see the code,if its not any of other listed can you share a code of GiveAdjustedTools()?

  • Button that equips maybe have issue because first react only once,you can test if its that problem by just double clicking on same button outside of cave

2 Likes

Thanks for the help but no, none of the above are at fault. GiveAdjustedTools() does NOT interact with UIs at all. And no the button works perfectly until its being covered by some kind of new UI or frame.

Are you completely sure that the buttons don’t work? Could there be a flag which enables itself during transitions and never toggles off?

They dont work. Not even their hover effects work. Im currently trying to reparent them so that the menus arent in new ScreenGuis. Ill get back to you when I’m done.

Yep turns out this is the problem.


ScreenGUIs with another ScreenGUI as an ancestor will not work reliably. Input may get disabled / ignored.



Or so this problem suggests. Thanks for all of your help, guys!
2 Likes