Help on improving my loading screen!

So I just finish coding my loading screen and its ok, but I want to improve it in two ways: actually make it load better, because when you watch this video, you can see that the car next to were i spawn doesn’t fully load, making me belive that the method i use for my loading screen isn’t good, or can be improved:
Desktop 2021 06 08 09 28 16 05 - YouTube
as you can see from the video, nothing actually loads well, and the loading screen lags a lot. so I’m wondering if there is anyway I can load things better,

I’ve heard of using ContentProvider, but i’m confused on using that, because it seems like its used for loading a few assets, not a whole game, so this is my script that i use for the loading screen:

--vars
local Players = game:GetService("Players")
local ReplicatedFirst = game:GetService("ReplicatedFirst")
local TweenService = game:GetService("TweenService")

local player = Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")

local screengui = script:WaitForChild("LoadingScreen")
local loadingImage = screengui:WaitForChild("ImageLabel")
screengui.Parent = playerGui -- setting GUI Container's parent to PlayerGui


ReplicatedFirst:RemoveDefaultLoadingScreen()--removes the default loading screen.
local tween = TweenService:Create(loadingImage,TweenInfo.new(4,Enum.EasingStyle.Linear,Enum.EasingDirection.In,-1),{Rotation = 360})--tween that i use for the loading screen
tween:Play()

wait(5)

--]]the code below is the method i use for the loading screen, like i said I want to load everything into the game, 
--because its a big map and i want to optimize every user's experience-]]

if not game:IsLoaded() then
	game.Loaded:Wait()
end
--destroys screenGui once its loaded
screengui:Destroy()

would this also be a better add on as well (to load parts into the game)?

workspace.DescendantAdded:Connect(function(Part)
	if Part:IsA("BasePart") then
		PartsLoaded += 1
		LoadingGUI.Load.LoadingNumber.Text = "Assets loaded: "..tostring(PartsLoaded) 
	end
end)

I think that the reason is because in the API Reference it tells that :IsLoaded() and .Loaded will only fire/return true if the initial instances loaded and I think initial instances refers to instances that were sent in the join phase, so that’s why the car and the map aren’t loaded yet when the loading screen is destroyed. Content Streaming | Roblox Creator Documentation

That’s because the client loading lots of assets in short time.

This could be a solution but you need to know how many parts you have in your game. I recommend destroying the loading screen when another instances are loaded and you can check if those instances loaded, for example: Checking if the character has loaded.

2 Likes