I thought I’d post this solution as I couldn’t find any simple and clear answers on the forums.
Problem:
Using text-scaled will cause text sizes to change based on the amount of text inside the label. Here you can see the less text, the larger the font size.
Solution:
Scale the text manually based on the players viewport size, this is well known but I never saw someone actually post a simple script to do it.
- Turn off text scaling
- Choose the font size you want
- Place this script into a Local Script inside your text label
local descriptionLabel = script.Parent
local camera = workspace.CurrentCamera
local defaultViewportX = 1530 --The viewport size of your roblox editor
local defaultTextSize = descriptionLabel.TextSize
local m = defaultTextSize / defaultViewportX
local function UpdateText()
local viewportSizeX = workspace.CurrentCamera.ViewportSize.X
descriptionLabel.TextSize = m * viewportSizeX
end
camera:GetPropertyChangedSignal("ViewportSize"):Connect(UpdateText)
UpdateText()
- Replace “defaultViewportX” with your studios current x-axis viewport size, you can find out the viewport size by placing this in the console:
print(workspace.CurrentCamera.ViewportSize.X)
Now no matter the person’s resolution/device, the text size will scale based on the viewport X size. Hope this helps.
*Edited to correct script mistake