New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Still have questions? Join our Discord server and get real time help.
Log in to vote

Maintaining an equivalent distance UDim between differently Sized GUIObjects #2?

Asked by
Feahren 1746 Moderation Voter
9 months ago

Hello again, thanks to a great suggestion on my recent issues, I'm now trying to configure everything to work with this method, at the moment I'm trying to use TextService to get going, and one thing I'm trying to print for validation is TextService:GetTextSize(), I believe I've formatted the required parameters correctly, if not please let me know. This is what I have

local VectorFillSize = ChatLabel.AbsoluteSize.X, ChatLabel.AbsoluteSize.Y
local vector2 = TestService:GetTextSize(ChattedMessage, 5, "ArialBold", VectorFillSize)

Console replies Unable to cast double to Vector2 Please help me out!

1 answer

Log in to vote
Answered by
gioni01 2040 Moderation Voter Community Moderator
9 months ago
Edited 9 months ago

You need to create a Vector2 value from your ChatLabel's AbsoluteSize.

local VectorFillSize =,ChatLabel.AbsoluteSize.Y)
local ReturnSize = TestService:GetTextSize(ChattedMessage, 5, "ArialBold", VectorFillSize)
--i wouldnt name your variable vector2, as it may cause confusion between the actual Vector2 variable. just remember that :GetTextSize() returns a Vector2, so thats what ReturnSize is

See how the frameSize argument is a Vector2 value on this page.

Accept and upvote if this helps!


Answer this question