I have a menu that will have 3 buttons. When the player enters I want all the buttons to slide into view one after the other. the problem is that I don't really want to put a script into each button to animate because I think that would be messy and I could need to add more buttons in the future. Here is my code that slides in a text button:
local frame = script.Parent -- the frame that holds the menu
for _,gui in pairs(frame:GetChildren()) do -- getting all the text buttons
if gui and gui:IsA("TextButton") then
gui:TweenPosition(UDim2.new(0.05, 0, 0.1, 0), Enum.EasingDirection.Out, "Quad", 5) -- animating the single text button I have in my screen gui
end
end
So how would I make the script so that:
- Gets all text buttons (done)
- Animates them into the screen (done)
- After the first button, the next button will come into view under the first button by a fixed amount (not done)
How would I do this? I'm guessing something to do with table indexes which I am not good at...

2 comments
But would that make the next button spawn under the previous one?
It's hard to explain, but no that wouldn't. You'd have to change line 5 to make it change the position, based on a variable.