I am trying to create a Tween for my shop gui, ive tried watching a couple of tutorials but none of them worked. I want to make it so when you click it, it comes goes from small to big. Heres an example:
Someone help please?
I am trying to create a Tween for my shop gui, ive tried watching a couple of tutorials but none of them worked. I want to make it so when you click it, it comes goes from small to big. Heres an example:
Someone help please?
Show Code that you’ve tried so far
local UI = script.Parent.Frame
local Button = script.Parent.TextButton
local Open = game:GetService("TweenService"):Create(UI, TweenInfo.new(0.4, Enum.EasingStyle.Quad), {Size = UDim2.new(0, 400, 0, 300)})
local Close = game:GetService("TweenService"):Create(UI, TweenInfo.new(0.4, Enum.EasingStyle.Quad), {Size = UDim2.new(0, 1, 0, 1)})
Button.Activated:Connect(function()
if (UI.Visible == false) then
UI.Visible = true
Open:Play()
else
Close:Play()
Close.Completed:Wait()
UI.Visible = false
end
end)
Set the AnchorPoint of the frame to 0.5, 0.5
and the position to 0.5, 0, 0.5, 0
You can use Gui:TweenPosition
or Gui:TweenSize
Here is a basic example:
Frame:TweenPosition(UDim2.new(0.335, 0, 0.224, 0))
I have never used TweenSize before but I am guessing it is pretty similar to TweenPosition.
I did exactly what you said but it’s still not working, and for some reason the shop isnt opening now. Did I do something wrong?
You are setting it to 1 pixel in width and length. Do you mean 0 pixels or do you mean a scale of 1,1?