Elements tweening in the wrong order

Hey.

So I have a game where you can simulate CS:GO case openings.

I have a bar at the top of the screen for recent openings that looks like this:

I also have a for loop to handle the tweening of the elements when an item is opened from a case:

for i = 1, #itemDrops do
	tween(itemDrops[i], TweenInfo.new(0.5), {Position = UDim2.new(0, (#itemDrops - (i - 1)) * 80, 0.5, 0)})
	
	itemDrops[i].Username.Text = i
	print(#itemDrops - (i - 1))

	if itemDrops[i].Position.X.Offset > drops.AbsoluteSize.X + 80 then
		itemDrops[i]:Destroy()
	end
end

The expected and intended behavior is for the items to tween over by 80 each time. When the Roblox window is less than around 1500 pixels, this is the behavior, however, when the window is above that, a behavior like this results:
hjGoURtaPo

I’ve tried tweening each item by using increments but that would cause overlaps.

Does anyone have any suggestions on how I should go about solving this problem?

I’m open to pretty much any idea.

Thank you!

1 Like

I’m not actually sure if I understand the problem. If you could provide more information, I might be able to assist you more. :slight_smile:

It’s a complicated system, I will just rewrite it.

Thank you though! :smiley:

1 Like