As a Roblox developer it is impossible to fully replicate the effect of the Humanoid nametag with BillboardGuis without implementing things Roblox has already done. There is no way to prevent BillboardGuis from clipping into parts, which is something that never happens with Humanoid nametags because they display AlwaysOnTop with occlusion behavior.
I am trying to create a custom nametag but it is possible for players to wedge themselves into certain places where their nametag is clipping into parts or is no longer visible.
Turning on AlwaysOnTop is undesirable because players should not be able to always see each other through walls, and I do not want to have to do an occlusion check myself by firing rays towards every single character to figure out if they are visible because this can be expensive. I assume Humanoid code is more performant because it can do these raycasts without crossing the Lua bridge.
Humanoids already do this logic to show the nametag, I should not have to reimplement it. I should be able to pass an instance or model as a property of the BillboardGui, and if it becomes sufficiently occluded, the BillboardGui should disappear. Alternatively, there should be a setting to enable occlusion, where if the adornee becomes occluded, the BillboardGui should disappear.