I made a button system which uses GetTextSize to position the text accordingly. This system works perfectly fine in studio, however when going in game the text size returned is not the same which makes the button not look correct.
I noticed that when first joining, the text size is not correct. However, when running the same function in console the correct size is returned. That means this only happens on join, which doesn’t make much sense to me. I also noticed that this does not happen all the time, sometimes the size is fine but most of the time it is incorrect.
I don’t know if sending the script will help as it’s only the GetTextSize function which is breaking, and like I said when running it in console it works perfectly fine. All I have is a LocalScript in StarterPlayerScripts which requires my module in ReplicatedStorage, then I require the function which runs
TextService:GetTextSize(name, label.TextSize, label.Font, config.maxButtonSize).X translated: (
TextService:GetTextSize("Trade", 14, Enum.Font.GothamMedium, Vector2.new(150, 30).X) and yes I made sure the arguments were the same, it’s just the return text size being different.
If anyone wants more info or knows why this is happening, any help would be appreciated, thanks.