PcoWSkbVqDnWTu_dm2ix
The Developer Hub is now deprecated and information on this page may no longer be accurate. To see our new and improved documentation, please click here. You can read more about the future of documentation here.
Collapse Sidebar

NameDisplayDistance

Player

float

The NameDisplayDistance StarterPlayer property sets the distance in studs at which this player will see other Humanoid’s names. If the property is set to 0, names are hidden. This property is set to StarterPlayer/NameDisplayDistance by default.

Note

If a Humanoid’s health bar is visible, you can set the display type using Humanoid/DisplayDistanceType.


Code Samples


Hiding Player Health and Names

This example demonstrates how to hide other Humanoid’s (Player and NPC) health bars and names.

This is done by setting the player’s Player/HealthDisplayDistance and Player/NameDisplayDistance properties to 0.

If you would like to display health bars and names, you set the properties to a value greater than 0. For instance, setting the properties to 100 means that the player will see other player’s health and names up to 100 studs away.

To modify the default values for players, you can change the values of the StarterPlayer/HealthDisplayDistance and StarterPlayer/NameDisplayDistance properties.