Allow characters to have their display name modified

User Story:

As a developer, it is inconvenient and potentially game-breaking to change a character’s displayed name.

Elaboration:

Changing a character’s displayed name is an elaborate process. There’s the naive approach which requires creating a dummy head in a model that can be named whatever:

Sample Code:
local oldHead = character.Head
local newHead = oldHead:Clone()
local weld = Instance.new("Weld", newHead)
weld.Part0 = oldHead
weld.Part1 = newHead

local dummyModel = Instance.new("Model")
local dummyHumanoid = character.Humanoid:Clone()
character.Humanoid.Changed:connect(function(property)
    dummyHumanoid[property] = character.Humanoid[property]
end)
charater.Humanoid.NameDisplayDistance = 0

dummyModel.Name = "CUSTOM NAME HERE"

dummyHumanoid.Parent = dummyModel
newHead.Parent = dummyModel
dummyModel.Parent = character

But this breaks the linking between the character and player since the Humanoid isn’t the character’s Humanoid. The character’s custom display name will always be grey and not match their TeamColor. This also breaks any scripts that don’t anticipate this kind of heirarchy (newHead getting hit by a raycast and its humanoid being damaged instead of the character’s humanoid).

There’s a more elegant approach however. When a character spawns, clone it, rename the clone, and then set the player’s character to the clone. That process is as follows:

Sample Code:
local ignore = false
player.CharacterAdded:connect(function(oldCharacter)
	if ignore then return end
	ignore = true

	--Default spawn system will still be fighting over the character
	--Spawn a new thread to wait for that to end
	spawn(function()
		player.Character = nil
		oldCharacter.Archivable = true
		local newCharacter = oldCharacter:Clone()
		
		newCharacter.Name = "CUSTOM NAME HERE"
		player.Character = newCharacter	
		newCharacter.Parent = workspace
			
        --Clean up any ForceFields that are cloned to the new character
		if newCharacter:FindFirstChildOfClass("ForceField") then
			while oldCharacter:FindFirstChildOfClass("ForceField") do
				oldCharacter.ChildRemoved:wait()
			end
			repeat
				local forcefield = newCharacter:FindFirstChildOfClass("ForceField")
				if forcefield then forcefield:Destroy() end
			until not forcefield
		end
			
		ignore = false 
	end)
end)

This alleviates most problems, but if a script isn’t anticipating a second CharacterAdded event to be fired each time a player respawns, this could cause problems. Since it’s still a hack, it’s not suitable to include in free models which have to be able to adapt to any kind of place. Also, while it is the more elegant of the two approaches, it is still messy. Something as simple as renaming a character requires this verbose of an approach and I don’t imagine this being a commonly thought of solution as it requires an understanding of why characters can’t be renamed to begin with.

Use Cases:

  • Adding roleplay class to character names e.g. “(Knight) EchoReaper”
  • Roleplay names e.g. “Louis de Frankia”
  • Gamer clan names e.g. “[RBX] EchoReaper”
  • Level in character name e.g. “EchoReaper - Lvl 09”
  • AFK tags e.g. “<AFK> EchoReaper”
  • etc

Desired Behavior:

There are a number of ways this could be approached. I think the most straightforward way would be to allow the character to be renamed, but that may not be the best we can do with the change. When modifying display names, it’s common to use multiple lines. Instead of just “Louis de Frankia”, I may want to use:

Louis de Frankia
  (Magistrate)

Instead of allowing the character to be renamed, I believe a more elegant and empowering solution would be to convert the current name tag into a BillboardGui which is parented to the character or humanoid. With this, developers will be able to freely customize display name text, add multiple lines, or even change the appearance without needing to rebuild their own display GUI from scratch.

In addition to that however, I still believe the character should be able to be renamed. It’s a weird idiosyncrasy and keeping it will just make characters awkward to work with. I imagine this is a restriction put in place to prevent impersonation, but as the platform has grown we have eased away from that with custom chat/leaderboards – coupled with this and that it’s already possible to rename characters for malicious reasons, the restriction on character renaming is now obsolete.

41 Likes

Or even better yet add a DisplayName property to Humanoid that is used for the displayed name instead of the name of the model the humanoid is in. This would then allow developers to rename humanoid characters (such as a player’s character) without needing to rename the character model or do anything all that special. Considering the Humanoid already has properties to control things like NameDisplayDistance and NameOcclusion, it would just make sense to also have a DisplayName property to change the name shown. The default for this property would be “Humanoid” for non-player humanoids and the player’s name for player character humanoids.

19 Likes

The downside to just changing display text is that it’s not possible to customize the appearance of the label.

1 Like

I think at that point you might as well just turn if the name displaying and create your own kabel. A property for humanoid makes most sense to me for quick changes to the name like in the examples you give but beyond a custom billboard gui implemented by the developer is more suitable imo.

2 Likes

It’s not practical to rewrite ROBLOX’s humanoid display just to change the appearance. To make a small change like modifying the font size, font, or adding a second line, I would have to:

  • Build NameOcclusion (hiding display behind walls) from the ground up
  • Has to be perfect or else it and the health display won’t be in sync
  • Rebuild the health display if it interferes with what I want to do with the name display
  • As opposed to just changing position/etc if the BillboardGui were exposed directly
  • Spend time replicating the exact appearance of the current name label
  • Visit games with custom name labels and they look awful: overly-large, scale incorrectly, etc – it’s not trivial to create a good-looking name display

No one should have to rebuild ROBLOX features in order to slightly customize them. The goal of this is to follow what the camera/controlscripts and new chat are doing: allowing developers to use an existing, well-tested and well-developed feature but giving them complete creative freedom over customization.

From another angle:

If the BillboardGui is exposed, developers who want to customize its appearance benefit. If it’s not exposed, who benefits? Developers can set character.Name regardless if they just want to change the display name, but without exposing the BillboardGui anyone who wants to customize its appearance is out of luck. There are only losers if the name/health display BillboardGui isn’t exposed.

5 Likes

Custom nametag means you can customize to your wildest dreams what a nametag can look like in your game.

4 Likes

Support. Having to dig up the way to change a character’s display name is really annoying, really don’t see how this feature could be that hard to implement.

3 Likes

Definitely a lot of support for this one, I think it’s highly inefficient to change the name of a player’s character model in order to change the display name, and even more inefficient to create a dummy head. It would also be cool to see some built-in support for custom nametag guis

3 Likes