How to have a BillboardGui always be on top of certain objects?

I’m making a custom nametags system, and I was wondering how I would have the nametag always be on top of the character’s accessories, and only on top of the character’s accessories.

The problem:
image

I’m looking for a way to display the BillboardGui on top of certain objects, not AlwaysOnTop, and not StudsOffset.
(Like Roblox’ default nametags system, always shows above the character, but not other objects. Similar behavior to AlwaysOnTop, but only on top of specified objects.)

The AlwaysOnTop property of the BillboardGui class should work. This places the billboardgui on top of other objects.

You can use the StudsOffset property of BillboardGui. Just need to change the Z to be like 1 or 2.

1 Like

add a slightly tall part using Instance.new, welded (using a weld constraint) to the player and unanchored. Also add a billboard gui to it.

This is impossible without coding, all I can do is to detect if the other player can see the player with tag.

If A player can see B player’s head, make B player nametag’s AlwaysOnTop true.
When A player can’t see B player’s head, make B player nametag’s AlwaysOnTop false.

Basically if you want to make this, you will have to know how to code Raycasting and detect if there is an obstacle between two player’s head.

2 Likes

Sorry to bump this. I just wanted to share the solution because this was something I was wondering about as well.

Set BillboardGui.ExtentsOffset to 0, 0, 1. This will always move the billboard gui in front of the thing it is inside of towards your camera. I recommend making a model and putting your objects inside of it, then adding a billboard gui to that model with this setting for the desired effect.