[Help] BillboardGui won't parent to PlayerGui

  1. What do you want to achieve?
    I’m trying to make a Dialogue System but I can’t parent my “options” BillboardGui to the PlayerGui so it shows the content of that BillboardGui into the character torso. (This is a part of the script, is Not the entire script).

  2. What solutions have you tried so far?
    I’ve tried lots of things and I can’t figure out why It’s not working like I’d like it to work…

if currentDialog and currentDialogData == dialogConfig and character:FindFirstChild("dialoglink") and isDialogActive then
			if #dialogLineInfo.choices > 0 then
				print("Choices available:", #dialogLineInfo.choices)
				local optionsClone = dialogTemplate.options:Clone()
				optionsClone.Parent = playerGui
				playerGui.Options.Adornee = character:FindFirstChild("Torso")
				optionsClone.Visible = true

				for i, choice in pairs(dialogLineInfo.choices) do
					print("Choice:", choice.text, "Next:", choice.next)
					local choiceClone = optionsClone.safezone.template:Clone()
					choiceClone.Name = i .. "option"
					choiceClone.choicenum.Text = tostring(i .. ". ")
					choiceClone.text.Text = choice.text
					choiceClone.Parent = optionsClone.safezone

					choiceClone.button.MouseButton1Click:Connect(function()
						print("Choice clicked:", choice.text)
						if character:FindFirstChild("dialogline") then
							character.dialogline:Destroy()
						end
						CreateDialogLine(dialogConfig.dialog[choice.next])
					end)
				end
			else
				print("No choices found in dialog line.")
				EndDialog("No More Dialog Responses")
			end
		end

“options” BillboardGui content, I want the “Template” to be the choices.
image

Make sure the optionsClone is directly parented to the ScreenGui in the PlayerGui and not nested under another UI element, as BillboardGui must be a direct child of a ScreenGui or SurfaceGui . Then, set the Adornee property of the optionsClone to the character’s torso, and check that the AlwaysOnTop property of the BillboardGui is set to true so it appears above the character.

from your script, you probably already have clone the billboard and parented it into playergui. you can look into the explorer when playing and check

but you may have not set the Adornee correctly

it should be optionsClone.Adornee = character:FindFirstChild("Torso")

also, “Torso” is for R6. if the game uses R15, then i believe it is either UpperTorso or LowerTorso

local torso = character:FindFirstChild("Torso") or characterFindFirstChild("UpperTorso")
optionsClone.Adornee = torso

after that. because it is right at your torso, you have to adjust the billboard offsets to make it viewable from the camera

it needs either parent into workspace
or if it needs to receive user input, then we can parent it directly under PlayerGui (no need an extra level of ScreenGui)

You were right, the Adornee wasn’t set correctly (I’m using R6, so Torso is correct), but I still have the same issue as before. The "options" BillboardGui is not being parented correctly to PlayerGui, and I don’t know why. I checked in the explorer while playing, and it doesn’t appear anywhere.

Since it needs to receive user input from players to make a choice, I need to parent it under PlayerGui. Here is when I cloned the BillboardGui for the first time:

if currentDialog and currentDialogData == dialogConfig and character:FindFirstChild("dialoglink") and isDialogActive then
			if #dialogLineInfo.choices > 0 then
				print("Choices available:", #dialogLineInfo.choices)
				local optionsClone = dialogTemplate.options:Clone()
				optionsClone.Parent = playerGui
				optionsClone.Adornee = character:FindFirstChild("Torso")
				optionsClone.Visible = true

how did you find the “playerGui”?

local player = Players.LocalPlayer
local playerGui = player.PlayerGui

you may also print(playerGui:GetFullName())

Like this:

local localPlayer = game.Players.LocalPlayer
local playerGui = localPlayer:WaitForChild("PlayerGui")

looks like it should have found it.
would you print out more after

optionsClone.Visible = true
print(optionsClone.Parent)
print(optionsClone.Adornee)

Seems like I’m not reaching that part of the script, so I’m not getting those prints in the output.
image

"Should I share the entire script? I’m losing my mind, lol.

judging from the original script, it is checking #dialogLineInfo.choices
so you may need to print(dialogLineInfo) and see if the entire object is what you want