Here’s the source code if anyone wants it
Code
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Debris = game:GetService("Debris")
local RunService = game:GetService("RunService")
local Spring = require(ReplicatedStorage.Packages.Spring)
return function()
local dots = script.Parent.Loading.Main.Dots:GetChildren()
local connections = {}
local rot = 0
local function lerp(a, b, t)
return a + (b - a) * t
end
table.sort(dots, function(a, b)
return tonumber(a.Name) < tonumber(b.Name)
end)
for i, dot in ipairs(dots) do
local offset = dot.Position.X.Offset
local y = 0
table.insert(connections, RunService.RenderStepped:Connect(function(dt)
local t = os.clock() - (i*0.3)
y = lerp(y, math.sin(t*2.5) * 30, 1)
dot.Position = UDim2.new(0.5, offset, 0, y)
-- for fade effect
--local trail = dot:Clone()
--trail.Parent = dot.Parent
--Spring.target(trail, 1, 6, { BackgroundTransparency = 1 })
--Debris:AddItem(trail, 0.3)
end))
end
-- for rotation (180 is the rotation amount in degrees)
-- RunService.RenderStepped:Connect(function()
-- local t = os.clock()
-- rot = lerp(rot, math.sin(t) * 180, 1)
-- script.Parent.Loading.Main.Dots.Rotation = rot
-- end)
end