While using @evaera Radial Sprite Sheet Generator to create progress indicators for my game, when activated, they appear to start in random locations as shown in the GIF below.
Here is code:
local timeDelay
local done = false
local lastTick = -0.1
local current = 0
local function actionDelay(delayTime)
done = false
local RadialImage = require(ReplicatedStorage.RadialImage)
GUI.Progress.Enabled = true
timeDelay = delayTime
lastTick = -0.1
current = 0
r = RadialImage.new(script.RadialConfig.Value, GUI.Progress.Frame.ImageLabel)
while delayTime > 0 do
delayTime = delayTime - 1
wait(1)
end
return done
end
RunService.Heartbeat:Connect(function(step)
if (r) then
current = (tick() % timeDelay) / timeDelay
if current <= lastTick then -- Reached end
r:UpdateLabel(0)
r = nil
GUI.Progress.Enabled = false
current = 0
lastTick = -1
done = true
else
r:UpdateLabel(current)
end
lastTick = current
end
end
```