What would be the best way to make a loading screen scene changer

I’m trying to test making a loading screen for something, what would be the best way to make it?

I currently have pre-made frames that I want to become visible, and invisible.

Would there be a better way? Using events? Creating all of it using a script?

Clarification: It’s a loading screen for 1 place, no teleports involved.
Code does run when the pre-made frames are visible. The frames are stored in StarterGui.

I don’t want to know anything about the looks, I want to know if this is the best way to RUN the loading screen, since I’ve seen some open sourced games make their loading screens using scripts only, or having them in parts, and then moved to the PlayerGui or something.

1 Like

Actually it’d depend, are you just teleporting to another place instance inside of your game?

Just a loading screen for a game, no teleports involved.

Another clarification:
Code does run when the pre-made frames are visible. The frames are stored in StarterGui.

Code is just fade in/out and typewrite.

I’d take a look at this then, basically this gets an array to load & it’ll yield it’s current thread until everything is loaded I believe

You could also configure around with the frame’s loading screen if you have one

I’d say add tweens for more fluid transitions when changing UI frames. This will make your loading screen smooth and clean.

Sorry, I didn’t explain it too well.

It’s a loading screen, for when the player joins the game. You did mention PreloadAsync, what would be the best way to detect if the whole game is loaded?

I also wanted the best way to run the loading screen, not make sure it is loaded, but that would be undoubtedly useful.

How would I implement that? I’m not too sure what kind of tweens you meant.

Use these as a reference for figuring out your code:

The good thing about tweens is they’re easy to use!

1 Like

Thanks!
I still have one thing I want to ask -
Is my way the best way to run a loading screen?

(code does run during it)

I’m not asking about how good it looks, I want to know if it’s the best way to run it.

Also, is there a way to make a fade out effect with tweens?
(by fade out, I mean something like setting the transparency higher in a loop until it is 1.)

Having UI already made is fine, though making it a new instance through a script would better (in my opinion) it’s also more complex. There is a way to make a fade in/out effect, use the references I provided above to look more into this. You would need to tween the transparency property of the UI object for it to create the fade!

Would making it a new instance through a script be

  1. More laggy
  2. More clean

Also, I only know how to tween size, and position. I don’t see transparency anywhere on the refrences, could you point me in the right direction?

PreloadAsync is basically just how programmers do their loading screens

I believe you could do it like this:

local ContentProvider = game:GetService("ContentProvider")

local AssetsToLoad = {
    game.ReplicatedStorage.Stuff
}

ContentProvider:PreloadAsync(AssetsToLoad) --This will yield, or literally delay the thread of this code

Just get a Instance of what you wanna load, and it should hopefully load

Alright. I’ve heard of game:IsLoaded(), would that work?

I don’t think creating it as an instance would be laggy but, I agree it will be cleaner; this minimizes the amount of objects in-game as it starts and you’re able to essentially customize how you want them to act on your terms (this is good if you know UI properties by heart!).

Found a post with the reference I was talking about:

Feel free to utilize the search feature and find out more about this!

1 Like

DEFINITELY NOT LOOKING UP WHAT THAT IS

Well if you’d wanna make it client-sided then I’d probably assume so

(There’s also a literal darn LOADING SCREEN EXAMPLE OKAY THEN)