Hey developers! I have been working on making a loading screen and there is around 1380 assets that need to be loaded (at the time I am writing this).
I have been working on Text that provides the Number of loaded assets at that time…
I have developed 2 ways to do this, and heres why:
One of the methods, Is recommended by Roblox docs page, and it’s Accuracy is spot on. Its load time though, is awfully long, and takes around a minute to load all the assets.
The 2nd method, loads everything really quickly, but the count Accuracy given isn’t as accurate as the first method…
First Method’s code & Video:
(It does reach the Number 1,380, I just trimmed the video down and cut it off the little end by accident)
local AssetsInGame = {}
local NumberAt = 0
local MaxNumber = #AssetsInGame
for i, v in AssetsInGame do
ContentService:PreloadAsync({v})
NumberAt += 1
script.Parent.MainText.Text = "Loading ("..NumberAt.."/"..MaxNumber..") . . ."
end
Second Method’s Code & Video:
(1,329 is the final number and it never fully reach the max number any time I play test. The number changes each play test in the 1,250 - 1,360 range)
local AssetsInGame = {}
local NumberAt = 0
local MaxNumber = #AssetsInGame
local callback = function(assetId, assetFetchStatus)
if table.find(AssetsInGame, assetId) then
table.remove(AssetsInGame, table.find(AssetsInGame, assetId))
NumberAt += 1
script.Parent.MainText.Text = "Loading ("..NumberAt.."/"..MaxNumber..") . . ."
end
end
ContentService:PreloadAsync(AssetsInGame, callback)
So my question is. Is there a way to merge these 2 to keep a quick load in time, while keeping Accuracy?
Any help is much appreciated!