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.
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.
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!
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
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!