Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why doesnt this tween the size of the gui object?

Why doesnt this tween the size of the gui object?

local LoadingScreen = game.StarterGui.Guis.LoadingScreen.ScreenGui
local TweenService = game:GetService("TweenService")

local ImageLabel = LoadingScreen.ImageLabel
ImageLabel.Anchorpoint = Vector2.new(0.5,0.5)
ImageLabel.Position = UDim2.new(0.5,-1,0.5,0)
ImageLabel.Scale = UDim2.new(5,0,5,0)

local EndScale = UDim2.new(0,0,0,0)

wait(10)
ImageLabel:TweenSize(UDim2.new(EndScale),nil,nil,3)

*The "Guis" object is a folder

2 comments

0

why are you "udim2"ing a udim2? it returns {0,0},{0,0} which is what you want but still

0

Also small sidenote, you don't need to include TweenService if you're using the Tween functions for GUI objects directly. You only need TweenService if you're using TweenService:Create()

1 answer

✓ Accepted answer

You're attempting to tween the GUI sitting in the StarterGui, not the one which is cloned into your PlayerGui.

You can access the cloned GUI's for a player using game.Players.LocalPlayer.PlayerGui

Furthermore, your actual UDim2 is invalid. UDim2 has 2 valid constructors: UDim2.new ( number xScale, number xOffset, number yScale, number yOffset ) UDim2.new ( UDim x, UDim y )

You're trying to provide a UDim2, nil, nil and 3. This doesn't match anything, also, nils are not allowed values inside UDim2 values. You must at least provide 0.

1 comment

1

StarterGui is a different thing to PlayerGui, the startergui tells the playerGui what it needs to start, yet the playerGui is the guis shown to the player, as flowery said.

This discussion is preserved as it was. New answers, comments, and votes are closed.