So basically what i am trying to do is make it so that when you click on the start button when you join the game a black square will grow to cover the screen then shrink back down. Problem is that i can't figure out how to do said thing
local GUI = script.Parent local Frame = script.Parent.Parent local tran = script.Parent.Parent.Parent.Transition.Frame function onClick() tran:TweenSize(100, 0,100, 0), "out", 1) Frame.Enabled = false wait(1.5) tran:TweenSize(0, 0,0, 0), "out"1) end GUI.MouseButton1Down:Connect(onClick)
thats all i have gotten
You're using the TweenSize function wrong. The syntax is:
guiobject:TweenSize(UDim2.new(ScaleX, OffsetX, ScaleY, OffsetY), easingDirection, easingStyle, time, override, callback)
Whereas..
UDim2 is a type of coordinate for UI developing. More on https://developer.roblox.com/en-us/api-reference/datatype/UDim2
ScaleX, and ScaleY are 0-1 values that depends on their parent's size (or the screen size if it does not have a parent). They represent width and height (multiplied by parent or window size) respectively.
OffsetX, and OffsetY are number values that nudges the object by pixels. They also represent width and height respectively but unlike Scale values they don't depend on screen size or parent size.
easingDirection is an enum for animation direction. Default is Enum.EasingDirection.Out
easingStyle is an enum for animation style. Default is Enum.EasingStyle.Quad
time defines animation duration
override allows for replacing an on-going animation applied to the object
callback allows for functions to be run after the animation
Example:
-- Pretend this script is inside a gui. local testbox = Instance.new('Frame', <the gui>) testbox:TweenSize(UDim2.new(1,0,1,0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, 5, false) -- fills the whole screen for 5 seconds.
You can approve this if it helped you.
You're welcome.