I'm trying to make a basic card game and want the cards to change position depending on how many cards there are like this: https://gyazo.com/a249f906ce3c77364101551f9a3113a4
In the gif whenever the user places a card somewhere else, the other cards they're holding move through the x axis to be symmetrical.
Right now my game draws 5 cards but when 1 card leaves the rest of the cards stay in their place. https://gyazo.com/98907c6df40faebdb5dae226339cbeb9
function FindChildren(Object)
local c = game.Players.LocalPlayer.Backpack.Hand -- Counts how many cards in hand
for i,v in pairs(Object:GetChildren()) do
if v:IsA("Frame") and v.Name == "Card" and c.Value < 5 then -- Finds frame named card
local d = 0.425 + (c.Value * 0.064) -- d is the distance between each card drawn
c.Value = c.Value + 1 -- counts the card in a number value
wait()
v:TweenPosition(UDim2.new(d, 0, 0.822, 0), "Out", "Quint", 1.5, true)
wait(0.5)
end
FindChildren(v)
end
end
Any tips on what I could do to center the cards depending on the value in game.Players.LocalPlayer.Backpack.Hand ?

2 comments
I think you may be able to achieve this using the UI Constraints (list layout maybe)
Hi thank you list layout achieved what I was trying to do.