How do I make an Assets Loading screen that completely works?

Hello, I am trying to make a loading screen that waits until absolutely everything is loaded and also shows the amount of assets loading, then will take you to the intro.

The system I currently have for this kind of thing is the only good one I have.
It is only one line of code.

repeat wait() until game:IsLoaded()

The only problem with this system is that it loads the intro before anything has really loaded, and that’s a problem. So I have been trying to find out how to make one of those “Loading Assets” screens, which I don’t know entirely how to code.

I tried searching up tutorials on YouTube, but all I could find were those horrible loading screen videos that enters you into the game after a provided amount of time instead of waiting until the game has actually finished loading. So if somebody put that into a really big game, the loading screen would vanish before half the assets were even loaded.

I have already tried this method (with a loading bar):

while wait() do
	queue = game.ContentProvider.RequestQueueSize
	LoadingUI.Frame.Frame.AssetsLeft.Text = "(" .. queue .. ") assets left to load."
	LoadingUI.Frame.LoadingBar.LoadingBar.Size = UDim2.new(1/queue, 0, 1, 0)
	if queue == 0 then
		LoadingUI.Frame.Frame.AssetsLeft.Text = "Assets Loaded."
		LoadingUI.Frame.LoadingBar.LoadingBar.Size = UDim2.new(1, 0, 1, 0)
		wait(1)
		LoadingUI:Destroy()
		break
	end
end

It’s meant to wait until the assets are loaded, and that’s what it does in Studio.
But for some reason in the actual game, it does this:


Basically, what’s happening here is the script thinks there are no assets left to load, when really, there are, and loads the game. That’s a big problem, because it loads the game before the camera (I use Camera Scenes for my intro) and messes up the camera, and sets the camera to my character instead of the scenes. This means this method is worse than the one I previously used.

I did find a tutorial on YouTube which correctly loads everything, but this method is extremely slow and I want an intro that loads fast, correctly loads everything in the game and doesn’t glitch when you play the game.

Is there another solution I could try, or am I stuck on the old intro?

4 Likes