PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience

Humanoid Display Distance

Humanoid Display Distance

Jul 03 2018, 11:26 AM PST 2 min

The Humanoid instance is used to help create character models, both for player characters and NPCs. When inserted into a Model that has a Part called Head in it, Roblox will display name and health information above the model. The distance at which this information can be configured for each character in your game or can be hidden entirely. The display behavior is based on the Humanoid/DisplayDistanceType, Humanoid/HealthDisplayDistance, and Humanoid/HealthDisplayDistance.

None

When the Humanoid/DisplayDistanceType is set to None the Humanoid’s name and healthbar will not be displayed under any circumstances.

Viewer

When the Humanoid/DisplayDistanceType is set to Viewer the Humanoid’s name and healthbar will be displayed based on the display distance properties of the viewing player. This can be useful when you want one player to see healthbars further than the other players. If every character’s DisplayDistanceType is set to Viewer, but the one player’s Humanoid/HealthDisplayDistance is larger than everyone else’s, then that player will see everyone’s health bar from further away.

In this example all of the NPC characters have their DisplayDistanceType set to Viewer. This means the distance the information will be displayed will be taken from the humanoid that is viewing them. In this case, the player character (who is in the foreground) has its HealthDisplayDistance set to 10 and NameDisplayDistance set to 20. The health bar is only visible on the closest NPC because it is within 10 studs, and the names of only the two closer NPCs are visible because they are within 20 studs.

HumanoidViewerDistance.png

Subject

When the Humanoid/DisplayDistanceType is set to Subject the Humanoid’s name and healthbar will be displayed based on the viewed humanoid’s settings. This is useful when there are specific characters who you want to behave differently from other ones.

In this example all of the NPC characters have their DisplayDistanceType set to Subject. This means the view distance of their information will depend on their individual HealthDisplayDistance and NameDisplayDistance properties.

  • The NPC on the left has its HealthDisplayDistance and NameDisplayDistance set to 10. Since the NPC is 15 studs away neither info is visible.
  • The NPC in the middle has its HealthDisplayDistance set to 10 and NameDisplayDistance set to 20. Since the NPC is 15 studs away only the name is visible.
  • The NPC on the right has its HealthDisplayDistance and NameDisplayDistance set to 20. Both name and health are visible as the NPC is 15 studs away.

HumanoidSubjectDistance.png

Tags:
  • humanoid
  • camera