I’m trying to make this slide smoothly, but for some reason everything becomes chaos after a while of the wheel spinning. Here’s the script and a video of what’s happening:
spawn(function() local speed = 20 local subtractionMultiplier = 1 while speed > 0 do speed -= (0.05 * subtractionMultiplier) subtractionMultiplier += 0.006 for _, template in pairs(caseOpeningFrame:GetChildren()) do if template:IsA("Frame") then template.Position = UDim2.new(0, template.Position.X.Offset + speed, 0, 0) if template.Position.X.Offset >= 500 then template:Destroy() local temp = CreateRandomTemplate(caseInfo) temp.Position = UDim2.new(0, (lastCreated.Position.X.Offset - 100), 0, 0) temp.Parent = caseOpeningFrame lastCreated = temp end end end wait() end end)
As you can see, it’s not smooth at all. I know how to fix the problem with the images not generating quickly enough, but I can’t seem to fix the frames slowly spacing out / overlapping.
Does anybody know how to fix this? Thanks in advance.