:IsLoaded() not really working?

I’m trying to create a custom intro screen, and all the animations, etc. I have are running before the game has even loaded.

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

print('Game has loaded')

The print is printing well before my screen has loaded in


(right click>open image in new tab to see the full image)

3 Likes

Whenever you insert anything into ReplicatedFirst it will make the default loading screen last 5 seconds unless its removed.

3 Likes

When elements are inserted into ReplicatedFirst or RemoveDefaultLoadingScreen is called, as previously mentioned, the CoreScript responsible for handling the loading Gui waits 5 seconds before removing it, regardless of anything:

IsLoaded then detaches from the loading screen. IsLoaded and Loaded fire as in when the server has finished replicating instances to the client. When the default screen disappears has nothing to do with either of those values anymore.

IsLoaded and Loaded have nothing to do with actual loading, it has to do with the state of replication of the game to the client. This is expected behaviour.

My game uses the Content Provider and waits until the Content queue is 0. I used local images in the roblox assets folder (\images\loadingCircle.png or something like that as the asset ID). This ensures that the loading circle is already pre-loaded on the client and the Loading circle doesn’t have to load itself.

Keep in mind the waiting doesn’t happen with wait() - this would freeze up the loading screen until everything is loaded, so any circles or whatever won’t spin. Instead I RenderStepped:Wait() so every rendered frame, my code to rotate the circle runs (the amount it rotates is based on the elapsed time after the last render frame - you’ll need some math to determine how long to wait.)

You can check out my loading screen in Midnight Racing: Tokyo if you’re curious as to how it looks.

Do not do this. There is a reason Roblox allows you to join games without loading every asset. If you do this, players will be unnecessarily waiting until every asset loads in the game, even if they are not important or even remotely visible. Your join time increases from a few seconds to 10-20 seconds, even though the game is completely usable after the first few seconds.

If there are important assets you want loaded, you should use PreloadAsync. Otherwise, you shouldn’t be waiting for them to load.

3 Likes

I find that when I allow people to join using roblox’s default loading screen, the world’s assets (the actual parts) aren’t always finished loading. This causes people to walk on invisible parts and look at grey players for a super long time. Any better way I could be going about this without experiencing a half-loaded game?

1 Like

Grey Players: grey players are significantly less worse than staring at a loading screen forever. I’m not sure how a loading screen does any good here

Invisible Parts: I think you mean unions/meshparts? These will be invisible until their meshdata is downloaded. If there are any critical assets (e.g. floors), you can preload them with PreloadAsync and keep up a loading screen until those are done, but you shouldn’t be blocking the player from playing the game until all meshparts/unions are loaded. An invisible prop on a table like a lamp is not significant enough to block behind a loading screen since it doesn’t affect gameplay. Some invisible floors in a far-off building players won’t be able to access within the first few seconds of playing the game are not significant enough to block behind a loading screen since they will already be loaded by the time the player reaches them without any loading screen.

5 Likes