Loading screens that really work

Hello developers !!! :smiley:
There are games that have a loading screen that is real, when this screen really ends and is removed, everything appears saved, and it’s not just decoration, but I can’t find anything, can someone tell me how this is done please?
Thanks!

3 Likes

You could use repeat wait until game:IsLoaded(). Not sure if it still works, though.

Put it in a local script in ReplicatedFirst, and destroy/tween the gui out when it’s done loading.

2 Likes

Yes, that should work, but for example, I want to make the logo appear and turn the color from black with a gradient little by little like the one in Bubble gum simulator, but it will be ugly if it stands still for a while, kind of detect that kind of things.

To make a loading screen like that, I believe you’d be able to do it if you use an unsaturated image, along with a saturated image inside of a frame with clipsdescendants enabled, and tween the position of the saturated image from -1 to 0 on the y scale. Sorry if that seems confusing.

1 Like

If you’re wanting the screen to have a loading bar that waits for assets in the game to be loaded by the client, the ContentProvider’s PreloadAsync method can be utilized. An example of how it can be used for a loading bar is actually on the RequestQueueSize page, however.

Here’s the example that is provided on the Developer Hub:

local ContentProvider = game:GetService("ContentProvider")
local Players = game:GetService("Players")
 
-- create a screenGui
local localPlayer = Players.LocalPlayer
local playerGui = localPlayer:WaitForChild("PlayerGui")
local screenGui = Instance.new("ScreenGui", playerGui)
 
-- create a basic loading bar
local frame = Instance.new("Frame", screenGui)
frame.Size = UDim2.new(0.5, 0, 0.1, 0)
frame.Position = UDim2.new(0.5, 0, 0.5, 0)
frame.AnchorPoint = Vector2.new(0.5, 0.5)
 
local bar = Instance.new("Frame", frame)
bar.Size = UDim2.new(0, 0, 1, 0)
bar.Position = UDim2.new(0, 0, 0, 0)
bar.BackgroundColor3 = Color3.new(0, 0, 1)
 
-- create some sample assets
local sound = Instance.new("Sound")
sound.SoundId = "rbxassetid://301964312"
local sound2 = Instance.new("Sound")
sound2.SoundId = "rbxassetid://301964312"
 
-- create a table of assets to be loaded
local assets = {
	sound,
	sound2
}
 
wait(3)
 
for i = 1, #assets do
	local asset = assets[i]
	ContentProvider:PreloadAsync({asset}) -- 1 at a time, yields
	local progress = i / #assets
	bar.Size = UDim2.new(progress, 0, 1, 0)
end
 
print("loading done")
7 Likes

Yes, I know how to do it, there is a simpler way, you just need a UIGradient and put the colors a gradient from white to black and then with TweenService you can modify the Offset.

Thank you! Just what I needed.

1 Like