I think I am misunderstanding what you are asking here. It all looks well and good to me.
Are you referring to how the UI text elements get closer to eachother? If so, I recommend turning on scaled text if not enabled already. Another fix I would try would be to set the text alignment to top (for the bottom UI element) and bottom (for the top UI element).
If this helps at all, let me know! If not, I’ll see what I can do!
This is an issue with the properties of your BillboardGui. Can you tell us, what unit you are using for the scale and position properties of the elements of your BillboardGui? (That is, scale or offset).
I recommend also sending a picture of your BillboardGuis hierarchy.
Okay, so what I would do is to change the properties to be in the offset unit. Although, this means that the BillboardGui will stay a constant size but it would fix the issue you are having. You can just modify the MaxDistance property to prevent it from being visible to all players no matter the distance.
Just to formulate another solution, can you send the properties (position and size mainly) of all the text labels?
You sent two images of the same instance. The rank and role gui.
And, why are all of these GUIs taking half of the space of the actual BillboardGui? I think that’s the issue. You need to set their size to something like {1,0},{0.333,0} and position them accordingly.
Can you change the view name distance to account for that, so you never see the far version.
Had that happen with a sign, think I changed fonts and a few things with the lighting effects.
Neither of your solutions worked - when I zoom out, only the username shows, and when I zoom in, everything mushes together. Changing the size only made it smaller.
is it possible for you to send a file containing only the billboardUI? it would be easier to solve/explain, instead of just being a back and forth reply chain.
the thing is that TextLabels will not appear when they are outside of their respective UI’s. even with properties such as ClipsDescendants turned off, the TextLabel won’t clip, it will just disappear.
the issue with your UI specifically is some of the scaling. here is the fixed version Container.rbxm (4.7 KB)
with the scaling/positioning (that you do in your script), when zooming out or in, the TextLabel sometimes drifts a little too far, which as talked about before, will completely hide the TextLabel. to easily avoid this, just make sure you use scale, and ONLY scale when scaling UI objects! (unless needed)
with your UI, your billboard has 3 objects, so i made all of the objects take a third of the Y space. (1, 0, 0.333, 0)
then, there is just the means of positioning things, its just math that i guess and checked. can’t really explain now. but my anchor points were wonky.
to summarize my rant, use scale for UI objects and make sure all objects are sized to fit within their parent.
Has to do with your UI positioning and AnchorPoints. Anchor items that need to be at the top with an AnchorPoint.Y at 0, and at the bottom with an AnchorPoint.Y at 1, also don’t use offset.
Something like this will work, however you will need to adjust your sizing (ex. what I did was put each label.Size.Y at 0.333, and put the BillboardGui.Size.Y at 1.25):
game.Players.PlayerAdded:Connect(function(Player)
local function updateTeamDisplay(Character)
if Player.Team then
local teamColor = Player.TeamColor.Color
Character.Head.Container.Role.TextColor3 = teamColor
Character.Head.Container.Role.Text = Player.Team.Name
else
Character.Head.Container.Role.Text = "No Team"
Character.Head.Container.Role.TextColor3 = Color3.new(1,1,1)
end
end
Player.CharacterAdded:Connect(function(Character)
local Container = script.Container:Clone()
Container.Name = "Container"
Container.Parent = Character.Head
local Rank = Player:GetRoleInGroup(GroupId)
Container.Rank.Text = Rank
Container.Username.Text = Player.DisplayName .. " (@" .. Player.Name .. ")"
Container.Role.AnchorPoint = Vector2.new(0.5, 0)
Container.Role.Position = UDim2.new(0.5, 0, 0, 0)
Container.Username.AnchorPoint = Vector2.new(0.5, 0.5)
Container.Username.Position = UDim2.new(0.5, 0, 0.5, 0)
Container.Rank.AnchorPoint = Vector2.new(0.5, 1)
Container.Rank.Position = UDim2.new(0.5, 0, 1, 0)
updateTeamDisplay(Character)
Player:GetPropertyChangedSignal("Team"):Connect(function()
updateTeamDisplay(Character)
end)
end)
end)
Hey there, thanks for the corrected script. Could you send your file of the Container? On my end, everything is fixed but the next is mushed together no matter what. You could have said it already but im getting confused. Thanks