Billboard Gui is not visible after cloning

I have a billboard gui that I clone. After I clone the billboard gui, I set the parent to the playerGui, then I set the adornee to a basepart in the workspace.

local d = script.Diamond:Clone()
d.Parent = player.PlayerGui
d.Adornee = clone

But then, I have to toggle the billboard gui on manually (after I wait)
(I should not have to wait and then enable the billboard gui)
(Yes I have tried having the .Enabled = true when its cloned instead of manually setting it in the code below)

task.spawn(function()
		task.wait(1)
		d.Enabled = true
end)

Expected behavior

The billboard gui should appear when the parent of the billboard gui and the adornee are set correctly.

Can you send a PlaceFile? I’m not able to repro this bug.

2 Likes

I was able to reproduce it by setting the BillboardGui’s Adornee to a cloned part, then changing its Enabled property before changing its parent to workspace like this.

local RUN_BUG_FUNCTION = true
local BUG_FUNCTION_RUN_DELAY_FIX = true

-- Has to be a cloned instance for it to bug
local m = script.Part:Clone(workspace)
-- Bugs regardless if the BillboardGui is cloned or not
local b = script.BillboardGui--:Clone()

b.Parent = workspace
b.Adornee = m

function bug()
	b.Enabled = true
	-- Changing the parent after setting enabled makes it not show
	m.Parent = workspace
	
	if BUG_FUNCTION_RUN_DELAY_FIX then
		task.delay(3, function()
			-- Has to be cycled like this in my testing
			b.Enabled = false
			b.Enabled = true
		end)
	end
end

function working()
	-- Changing the parent BEFORE setting enabled makes it show
	m.Parent = workspace
	b.Enabled = true
end

(RUN_BUG_FUNCTION and bug or working)()

It does not bug if the adornee is set beforehand or if the part is not cloned. It also does not matter if the Enabled property is true/false before runtime. BillboardGui cloning is also irrelevant.

Place.rbxl (52.7 KB)

1 Like

We looked into this bug and at this time our recommendation is to just keep the modified ordering by setting the cloned part’s parent first.

This is rather specific and resolving the issue would have a performance impact beyond just this specific use-case, since we would need to add a signal that listens to ancestry changes on the adornee. As such, I’m closing this ticket.