I want my required parts, or just the entire game, to load before the player starts loading in upon pressing play
When i press the playtest button, i run into a exception within my starterGui script that is looking for a part within a group in the workspace. The issue after trying to debug seems to be that by the time the player first initially loads in, those parts are only loaded afterwards most of the time, leading to the exception being hit because the parts being looked for technically dont exist in the workspace.
Yet, there are sometimes that these parts DO load, i just have to keep trying to reload the playtest until i pass the exception, im hoping you guys can help me solve the issue so that i dont have to spam it so much haha
The general solution is task.wait() until the game:IsLoaded() parameter is met.
Because clients are varying in their ping, memory usage, and many other factors, there is no effective way to ensure anything will ever exist on the client, especially now that StreamingEnabled exists.
game:IsLoaded() helps to subside this issue by indicating when the general assets have been loaded.
I agree with this approach. Additionally, I recommend using the ContentProvider service and PreloadAsync to ensure all essential assets are fully loaded before removing the load screen. This can help avoid issues where assets aren’t completely loaded by the time the load screen ends.