GUI Size via Scale results in Incorrect Size

I’ve created another project which reproduces the issue here.

  1. Hide a gui element which has a child with a size set to {1,0,1,0}
  2. Resize the Roblox window.
  3. Show the gui element. The child will be incorrectly sized.

If you then resize the window while the frame is visible, everything is resized correctly.

Here it is in Gif form: ec0612b6f1959269c17adc5e1295e831

Do people have a way to workaround this or do we need to wait on a fix from Roblox?

3 Likes

I can confirm that the bug is caused when the size is adjusted while the parent is invisible. This code causes the bug every time. (The problem is not unique to text objects, all GuiObjects have the same problem)

parent.Visible = false
child.Size = UDim2.new(1, 0, 1, 0)
wait()
parent.Visible = true
5 Likes

Thanks the report! We have filed a ticket and are looking into this.

8 Likes

Is there any fix? When it happens on mobile devices nothing can be done about it since the window size can’t be adjusted.

2 Likes

I can confirm this bug affects studio too, there is no need to start the game.

Changing the size while visible, fixes the descendants.

1 Like

Hey everyone, A ghetto fix (lol) I found that works is detecting when a gui instance becomes visible and changing the clipsdescendants property back and forth - this trick works with other properties as well but I chose clipdescendants:

local function FixSizingBug(GuiInstance)
	if (GuiInstance:IsA("GuiObject")) then
		local function OnVisibilityChanged()
			local IsClipsDescendantsEnabled = GuiInstance.ClipsDescendants
				
			GuiInstance.ClipsDescendants = not IsClipsDescendantsEnabled
			GuiInstance.ClipsDescendants = IsClipsDescendantsEnabled
		end
		
		GuiInstance:GetPropertyChangedSignal("Visible"):Connect(OnVisibilityChanged)
		OnVisibilityChanged()
	end
end

for _, Child in ipairs(MainGui:GetChildren()) do
	FixSizingBug(Child)
end

MainGui.ChildAdded:Connect(FixSizingBug)
--MainGui is a screen gui containing all of the gui instances
4 Likes

This bug appears to be fixed! Not sure how since a didn’t see a new version of studio come out, but I can’t reproduce anymore.

Still an issue for me


Can confirm this is happening to me too. I’ve recently been reopening my project to find that GUI elements size via scale appear far differently than how they are supposed to.


The bug is demonstrated in the first screenshot - the size of the play button is of scale {0.262,0.211} and appears almost invisible while the second screenshot shows the result of me after creating a brand new default frame instance into the ScreenGui in which all of the tiny elements were parented to. Just by inserting the frame - All GUI buttons displayed the correct size and scaled correctly. It is indeed still occurring across multiple games and has not been resolved.

Note that this issue has been present in both my original projects and team create group games to this day.

I’m having the same bug / problem but instead, with my UI instance being created by a script, at first it’s scaled at almost the minimum size when joining until screen is resized which updates the size to what it should be.

This applies for both Roblox studio and Roblox client.

https://haz.shx.gg/59rW3TY8z.gif

Just experienced this bug as well and I noticed it happening on a new frame that I inserted into my game. I can’t seem to get it to go away and it’s very annoying because I’m not able to push an update to one of my games because of this since it cuts off the entire GUI.

I’ve recently started to experience this bug in-game and in-studio. It’s solved by resizing the window, but incredibly confusing for users. Can’t seem to find any workaround.

1 Like

The same things happens to me


1 Like

I have just experienced this bug, but unlike other suggestions in this post, resizing the window does not fix it for me.

Hi,
I have this problem as well, this has been happening for almost 2 months.

I think that it is happening only to things that are not visible when the game starts and if you change something like size, position, transparency, etc. it will get fixed, but for some reason, I can’t fix it using a script.

3 Likes

Yea and It is fixed reseting the character

1 Like

Still happening, since today [1AM CEST 30th September 2021] it’s happening even more then usually. First only a few times and didn’t get reported much, but now it happens almost every time.

We use Tweening to open the guis with size and position. But disabling make it still happen.
At this point it’s getting annoying that after 2 months it still hasn’t been fixed, I hope this will be solved as quick possible. Because this gives a bad user experience and monetization if the shop doesn’t show up.


Example in Studio

Here’s a few reports from players:


Even the next page buttons sometimes do not show up making players think there’s not a next page while the rest does show up. [in-game]


Quest window [in-game]

4 Likes

I have experienced this bug too, mostly while playing in-game. Only sometimes the bug fixes when I resize window, but often it doesn’t. So I’m just stuck with broken Roblox games which are out of the devs control. I also had a case in studio with some ui not wanting to show correctly(acting just the same like everything else reported), only reopening studio fixed it tho.

2 Likes

I’m experiencing the same scaling issue with my plugin widget UI. The only fix for it is to resize the widget window, but it happens frequently enough that it could cause some readability issues. Additionally, TextLabels and other UI objects are completely invisible until the widget is resized along with the scaling being wrong issue.

Invisible Text:
image

Expected Result after Resizing Widget:
image

1 Like

This appears to happen for mobile users also:

The bug starts to happen more and more often. For some players it’s becoming not playable.

1 Like