Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why doesnt this tween the size of the gui object?

Asked by 5 years ago

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

0
why are you "udim2"ing a udim2? it returns {0,0},{0,0} which is what you want but still GGRBXLuaGG 417 — 5y
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()` User#834 0 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago
Edited 5 years ago

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
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. qothiu 16 — 5y
Ad

Answer this question