Trouble parenting billboard ui to character head

Hi, I’m parenting an overhead tag onto a player head, however, it doesn’t work on the head, just everything else.

What it looks like when I do .Parent = Character.Head VS .Parent = Character:
image image
Script:

game.Players.PlayerAdded:Connect(function(Player)
    Player.CharacterAdded:Connect(function(Character)
	    Character.Humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None --	Remove default Roblox overheads
	
	    local clonedUi = script.overHeadTag:Clone()
	
	    clonedUi.mainFrame.playerName.Text = Player.Name
	    clonedUi.mainFrame.playerRank.Text = Player:GetRoleInGroup(7273104)
	
	    clonedUi.Parent = Character.Head
    end)
end)

How can I make it parent to the characters head properly?

3 Likes

The parent doesn’t particularly matter (I prefer to have them either in the Character, Head or HumanoidRootPart) but make sure to also set the BillboardGui’s Adornee and offset. For offset my personal preference is either StudsOffset or StudsOffsetWorldSpace.

I recommend putting the billboard gui under STARTERGUI or in thos case the PLAYERGUI and setting the adornee to be the character’s head through a script!

clonedUi.Parent = player.PlayerGui
clonedUi.Adornee = player.Character:FindFirstChild(“Head”)

I’m on mobile sorry for not setting the appropriate script form.

Even if I set the adornee, it will not work.

I like to use head because it doesn’t like bounce when you move.

For the billboard, make sure AlwaysOnTop is enabled and set the max distance to see it. Distance is counted in studs.

Second, you can change the Offset by again, clicking on the billboard GUI and changing the StudsOffset. Make sure you are changing the y axis. (I suggest making the StudsOffset to 0, 2.5, 0)

You can also grab the character head in one variable like this: local character = player.Character:WaitForChild("Head")

I suggest putting the UI inside of ReplicatedStorage and cloning it from there, then parenting it to the head.

1 Like

The head is a MeshPart, it doesn’t hold accessories - therefore, they’ll be ignored and not accumulated to get the actual position of Top.

You could develop a formula to increase the position by comparing all accessories positions, and finding which one is greatest to use increment on the number to get the Top. Here’s a sample:

local highestNum = 0
for _, i in pairs(char.Humanoid:GetAccessories()) do
	if i.AttachmentPos.Y < highestNum and highestNum <= 0 then highestNum = i.AttachmentPos.Y end
end
overhead.StudsOffset = Vector3.new(0, 1.2 - highestNum, 0)
--1.2 is the default offset to fit above the head properly, without accessories

These accessories may mess with the results, as some meshes tend to have a bigger size in Y than actually thought to be, in position.

*don’t forget to set the Adornee property to head if it doesn’t align correctly.