What is the best proper way to script loading screens?

Okay so we all know that the best way to script loading screen is, getting all descendants of the game and preloading instances with ContentProvider. But I have a few questions in my head?

Question 1: when we are getting all descendants of the game, like this.

local assets  = #game:GetDescendants()
print(assets)
-- Output: 1000-1500

its giving a incomplete result, if we do this and if our game has, assets, models, map etc

if (not game:IsLoaded()) then
	game.Loaded:Wait()
end

local assets  = #game:GetDescendants()
print(assets)
-- Output: 4000-5000

so which one we should use it? i looked other scripters code. and the all of them using is first way(without waiting the game loads).

Question 2: Should we preload each instances in a loop or it should be loaded just once?

Which one it should be?

1:

local ContentProvider = game:GetService("ContentProvider")

local allAssets = nil  --all assets here

for _,v in allAssets do
	ContentProvider:PreloadAsync({v})
end

2:

local ContentProvider = game:GetService("ContentProvider")

local allAssets = nil  --all assets here

ContentProvider:PreloadAsync(allAssets)
1 Like

To be honest I have never made a loading screen work based off of how many assets there are. I just do it based off of fps and server ping so I can load all the player and character added events before they can do anything

1 Like