Why does tweening size make my GUI dysfunctional?

So I have a script that tweens a GUI size to give it a little popup effect. However, it makes my scrolling frame bar disappear!

When it tweens the GUI, the scrolling frame bar just vanishes. Everything inside the GUI stays visible, however. In studio, the scrolling frame is intact and visible. I also do not get any errors in the console.

I’ve been trying to fix this for quite some time and I am stumped.

My issue:

Size Tween Does Not Work

Tween script:

local Player = game.Players.LocalPlayer
local Inventory = Player.PlayerGui:WaitForChild("Main").PetInventory
local Button = script.Parent
local open = Inventory.Open.Value
local rebframe = Player.PlayerGui:WaitForChild("Main").RebirthFrame
local db = false

script.Parent.MouseButton1Click:Connect(function()
	if open == false then
		if db == false then
			db = true
		open = true
		script.Parent.ClickSound:Play()
		Inventory:TweenSizeAndPosition(UDim2.new(0.536, 0,0.66, 0),UDim2.new(0.5, 0,0.48, 0),"In","Quint",0.2)
			rebframe:TweenSizeAndPosition(UDim2.new(0, 0,0, 0),UDim2.new(0.5, 0,0.48, 0),"In","Quint",0.2)
			wait(0.2)
			Inventory.Open.Value = false
			db = false
		end
	else
		script.Parent.ClickSound:Play()
		Inventory:TweenSizeAndPosition(UDim2.new(0,0,0,0),UDim2.new(0.5,0,0.48,0),"In","Quint",0.2)
		wait(0.2)
		open = false
		end
end)

Any solutions would be appreciated! Thank you for your time.

1 Like

Maybe try to change the tweening size of the scrolling frame too?

I tried this script and it seems to work without the sound and the rebirth part

Oh, I already figured out a solution. Thank you for your help anyways!

1 Like

Hey I have the same pet system and now I’m facing the same problem how do i fix this?