I’m trying to make a custom name tag using a BillboardGui, and I’ve already got the design for it done. It includes a few TextLabels and a ScrollingFrame with some ImageLabels in it.
The problem I have is that setting the StudsOffset of the BillboardGui in Studio so that it is perfectly above my head isn’t really working, as it results in players who do not have accessories having the BillboardGui way too high above their heads. I’m looking for some advice on how I would set the StudsOffset to position above their head, and above their accessories, if they have any.
As you can see below, the name tag sits nicely above my antlers, but this was done manually using the StudsOffset property. However, you can see that my alternate account with no accessories except hair has the BillboardGui placed too high. In game, it looks silly as it is far too high above the head. If they do not own this game’s premium gamepass and aren’t entitled to any of the badges, it looks even more strange as all you can see is the name all the way up there.
I’m not sure if the best way to position the BillboardGui is by using the StudsOffset property; please let me know if there is a better way of doing so.
I’ve thought about a few solutions but they aren’t working as I need. I thought about making an invisible box inside the character which would be the same size as the character, as done below:
script.Parent.Size = game.Workspace.LegendOJ1:GetExtentsSize()
This does make the box and sizes it appropriately, but it only sizes it to where the head is, and doesn’t take into account any accessories. This means it would make no difference just placing the BillboardGui inside the head like I am already doing.
I think this could be done by getting the height of the model and setting the StudsOffset of the BillboardGui based on the height, though I’m unsure of how to get the height of the model with the accessories included.
As I said, I’m looking for some advice on how I would be able to set the StudsOffset of the BillboardGui so that it is just above the head, and takes into account the height of any accessories. Even just being able to get the height of the model with the accessories would be enough for me to set the StudsOffset based on that.
Thanks.