Name billboard on players only working on most but not all users; potentially related to R15 dynamic heads..?

I have a script I’ve been using for RP names / custom names displayed above players for about two years. However, I’ve noticed that while this seems to work for the vast majority of players, it does not work on all of them.
I originally thought it was an issue with users who have dynamic heads, but it works fine for some dynamic head users. When testing it on two avatars, it seemed to be fine for R6 but not for R15 when using dynamic heads. It could be coincidence though.
I’m wondering if maybe I missed something going defunct / depreciated, am not using the correct or up to date terms, or something like that. I’d appreciate any tips on how I could go about fixing this.
Attaching strictly my relevant code below. It seems to not even make it past “player.CharacterAdded:connect(function(char)”, as I tried putting print() past that point and none of them ever triggered when I changed myself to the avatars of two people who it doesn’t work for. It also doesn’t throw any errors or output at all in Studio.

game.Players.ChildAdded:connect(function(player)
	local name = Instance.new("StringValue")
	name.Name = "RPName"
	name.Value = player.Name
	name.Parent = player
	--
	
	player.CharacterAdded:connect(function(char)
		char.Humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None  
		
		local bill = Instance.new("BillboardGui", char:WaitForChild("Head"))
		bill.Name = "name"
		bill.Adornee = char:WaitForChild("Head")
		bill.Size = UDim2.new(1,0,1,0,0,0)
		bill.StudsOffset = Vector3.new(0,2.5,0)
		bill.MaxDistance = 90
		bill.AutoLocalize = true
		bill.DistanceLowerLimit = 0
		bill.DistanceUpperLimit = 20

		local text = Instance.new("TextLabel")
		text.Parent = bill
		text.Text = (name.Value.." ["..player.Name.."]")
		--

		name.Changed:connect(function(newName)
			text.Text = (newName.." ["..player.Name.."]")
		end)
		
		-- 
		
	end)
end)

I have also tested HDAdmin’s " ;name " command on a definitely non-working avatar, and not even that works. The model it’s supposed to make inside of the player character is never made. If cross-examining my own code and HDAdmin’s similarly non-working code would help, this is what that looks like:

function module:CreateFakeName(plr, name)
	local head = main:GetModule("cf"):GetHead(plr)
	if head then
		local fakeName = module:GetFakeName(plr)
		if not fakeName then
			fakeName = Instance.new("Model")
			local fakeHead = head:Clone()
			fakeHead.Name = "Head"
			fakeHead.Parent = fakeName
			fakeHead.face.Transparency = 1
			local weld = Instance.new("WeldConstraint")
			weld.Part0 = fakeHead
			weld.Part1 = head
			weld.Parent = fakeHead
			local fakeHumanoid = Instance.new("Humanoid")
			fakeHumanoid.Name = "FakeHumanoid"
			fakeHumanoid.Parent = fakeName
			fakeName.Parent = plr.Character
			head.Transparency = 1
		end
		if name then
			fakeName.Name = name
		end
	end
end

Again, would appreciate any help with or tips on solving this. It’s gotten incredibly annoying as of late.

have you tried setting the billboards adornee to only the character and not it’s head? This will most likely work however its offset will also be based on the models bounding boxes.

Oddly, this makes the billboard show up, though it seems laggier and moves awkwardly with the player. It also works when attached to the HumanoidRootPart. I don’t know why it’s JUST breaking with this.

When messing around with it, I tested a local script with a GUI button using a snippet of the code and it attached fine, so I don’t know what about the actual name script isn’t working or attaching. Local script test code was:

local button = script.Parent
local player = game:GetService("Players").LocalPlayer
local char = player.Character

button.MouseButton1Click:Connect(function()
	
	local bill = Instance.new("BillboardGui", char.Head)
	bill.Name = "test"
	bill.Adornee = char.Head
	bill.Size = UDim2.new(1,0,1,0,0,0)
	bill.StudsOffset = Vector3.new(0,1.66,0)
	bill.MaxDistance = 30
	bill.AutoLocalize = true
	bill.DistanceLowerLimit = 0
	bill.DistanceUpperLimit = 20
	
	local text = Instance.new("TextLabel")
	text.Parent = bill
	text.Text = "WORKED"
	text.FontSize = "Size12"
	text.Size = UDim2.new(1,0,1,0,0,0)
	text.BackgroundTransparency = 1
	
end)

If I’m unable to get it to attach to the head, I might have to suck it up and give it to the HumanoidRootPart, but I’ve been avoiding that because I’d have to figure out some math to calculate the size of a player in order to see how high up the billboard needs to be, + concerns about it looking strange if a player is using one of the game’s laying/sitting emotes but the name shows up far above them, or potentially any animations that end up reaching high enough to cover the text.

I’m going to keep working on it today and see if I can find any fixes myself, but I’m really not sure what the issue is.

1 Like

As a test, tried

game.Players.ChildAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(char)
		print(player.Character.Name, "yes")
	end)
end)

and it triggers & prints for R6 as far as I can tell, it triggers & prints for the non-working people’s avatars in R6, but the second I try the non-working avatars in R15 it says nothing. Is it potentially just not detecting there was any character added?? I genuinely have no idea what’s happening right now.

Have you tried parenting the BillboardGui outside of the character?

Fast cluster rendering might be messing with GUI rendering, specifically with dynamic/mesh-deformed models.

What’s a good way to go about doing this while still having it follow the character’s head?

I’m also not sure it’s just a rendering issue when the BillboardGui doesn’t even appear in the explorer on the non-working avatars’ heads, unless I’ve misunderstood what you mean by rendering.