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).
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.
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.
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
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