#BillboardGui Text Size

1 messages · Page 1 of 1 (latest)

glass prawn
#

I have a BillboardGui Size(10,0,2,0) -> Frame (1,0,1,0) -> TextLabel (1,0,1,0)
and my text wont shrink at distance, why?
It seems to only work when I have TextScaled enabled

bitter storm
#

or else you can manual scale with StudsOffset if you want more contorl

#
local RunService = game:GetService("RunService")
local camera = workspace.CurrentCamera
local billboardGui = -- your BillboardGui
local targetPart = -- the part the billboard is attached to

RunService.Heartbeat:Connect(function()
    if camera and targetPart then
        local distance = (camera.CFrame.Position - targetPart.Position).Magnitude
        local scale = math.max(0.1, 1 / (distance * 0.1)) -- adjust multiplier as needed
        billboardGui.Size = UDim2.new(10 * scale, 0, 2 * scale, 0)
    end
end)
glass prawn
#

yeah as i said it seems to only work when having it enabled but wont this cause to have different sized text depending on length? when i have player names being 3-20 characters

bitter storm
#

ORRRRRRRR

#

you can use

billboardGui.StudsOffsetWorldSpace = Vector3.new(0, 0, 0)
#

all those options wil lwork

bitter storm
#

fixed TextSize with distance scaling

TextLabel.TextScaled = false
TextLabel.TextSize = 14
TextLabel.TextWrapped = false
bitter storm
glass prawn
#

nope

bitter storm
#

hmmmm

#

try

TextLabel.TextScaled = false
TextLabel.TextSize = 14
TextLabel.AutomaticSize = Enum.AutomaticSize.XY
TextLabel.Size = UDim2.new(0, 0, 1, 0)
#

any news

glass prawn
#

also not

bitter storm
#

hmmmm

#

than we need the manual way

#

here

#
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local camera = workspace.CurrentCamera

local function updateTextSize()
    for _, player in pairs(Players:GetPlayers()) do
        if player.Character and player.Character:FindFirstChild("Head") then
            local billboardGui = player.Character.Head:FindFirstChild("BillboardGui")
            if billboardGui then
                local textLabel = billboardGui:FindFirstChild("TextLabel")
                if textLabel then
                    local distance = (camera.CFrame.Position - player.Character.Head.Position).Magnitude
                    local baseSize = 14
                    local scaleFactor = math.max(0.5, math.min(2, 100 / distance))
                    textLabel.TextSize = baseSize * scaleFactor
                end
            end
        end
    end
end

RunService.Heartbeat:Connect(updateTextSize)
#

use this

#

if nothing worked than youre cooked

glass prawn
#

not sure if itll work but

#

that seems like taking a sledgehammer to crack a nut

bitter storm
#

try it

glass prawn
#

ill just wait for somebody who knows how to, ty for the attempts

bitter storm
#

if it didnt work you can always undo