Assets Disappear After Loading Screen in Roblox

[Help] Assets are being deleted after the loading screen ends

Hello everyone,

I’m working on a custom loading screen that preloads assets before transitioning to the main menu. However, I’ve encountered an issue: once the loading finishes and the game moves to the main menu, all assets in the client begin to get destroyed.

Setup

  • The LocalScript is placed inside ReplicatedFirst to handle the loading process.
  • It clones the loading screen UI (ScreenLoadPlaying) from ReplicatedStorage, displays it in PlayerGui, and starts preloading assets from workspace using ContentProvider:PreloadAsync().
  • After loading, the script destroys the loading screen and enables the Main Menu UI (MainMenu).
  • The Main Menu LocalScript moves the camera to a new position.

Issue

Everything works fine until the loading process ends. When the EndLoad() function is called, the game transitions to the Main Menu, but all assets in the client start disappearing.

Code (LocalScript in ReplicatedFirst)

-- Services
local player = game:GetService("Players").LocalPlayer
local ReplicatedFirst = game:GetService("ReplicatedFirst")
local TweenService = game:GetService("TweenService")
local ContentProvider = game:GetService("ContentProvider")
local UserInputService = game:GetService("UserInputService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

-- Global Variables
local UIS = {}
local isLoad = true
local usedTipsIndices = {}
local lastTipUpdateTime = 0
local tipInterval = 10

-- Player Instances
local PlayerGui = player.PlayerGui

-- Instances
local ScreenLoad = ReplicatedStorage:WaitForChild("GUI"):WaitForChild("ScreensLoad"):WaitForChild("ScreenLoadPlaying"):Clone()
ScreenLoad.Parent = PlayerGui

local loadingRing = ScreenLoad:WaitForChild("Content"):WaitForChild("Loader")
local Assets = workspace:GetDescendants()

-- Events
local FinishLoadEvent = ReplicatedStorage:WaitForChild("Events"):WaitForChild("Player"):WaitForChild("ScreenLoad"):WaitForChild("FinishLoad")

-- Modules
local ScreenLoadModule = require(ReplicatedFirst.Modules.ScreenLoad)

FinishLoadEvent.Event:Connect(function(state)
	EndLoad(state)
end)

function StartLoad()
	for _, child in pairs(PlayerGui:GetChildren()) do
		if child.Enabled then
			child.Enabled = false
			table.insert(UIS, child)
		end
	end

	UserInputService.MouseIconEnabled = true
	ScreenLoad.Enabled = true

	ReplicatedFirst:RemoveDefaultLoadingScreen()
	
	local tweenInfo = TweenInfo.new(3, Enum.EasingStyle.Linear, Enum.EasingDirection.In, -1)
	local tween = TweenService:Create(loadingRing, tweenInfo, {Rotation = 360})
	tween:Play()
	
	Load()
end

function Load()
	local totalAssets = #Assets

	for i, asset in ipairs(Assets) do
		if not isLoad then return end

		local percentageLoaded = math.round(i / totalAssets * 100)
		ContentProvider:PreloadAsync({asset})

		ScreenLoad.Content.Loader.load.Text = percentageLoaded .. "%"

		if tick() - lastTipUpdateTime >= tipInterval then
			ScreenLoad.Content.Tip.Text = GetUniqueRandomTip()
			lastTipUpdateTime = tick()
		end

		if i % 200 == 0 then
			task.wait()
		end
	end

	EndLoad(false)
end

function EndLoad(isEvent)
	isLoad = false
	task.wait(0.1)

	ScreenLoad.Content.state.Text = isEvent and "Assets loaded successfully!" or "Assets skipped successfully!"
	task.wait(0.8)

	for _, child in pairs(UIS) do
		child.Enabled = true
	end

	ScreenLoad:Destroy()
	player:WaitForChild("PlayerScripts"):WaitForChild("MainMenu"):WaitForChild("MainMenu").Enabled = true
end

StartLoad()

Expected Behavior

  • The loading screen should preload assets and update the UI accordingly.
  • Once finished, it should transition to the main menu without affecting any assets.

Actual Behavior

  • The assets start getting destroyed after transitioning to the main menu.

Additional Information

  • Here’s a video showing the issue: Streamable Link

  • The ScreenLoadPlaying UI is stored inside ReplicatedStorage: GUI -> ScreensLoad -> ScreenLoadPlaying.

  • The MainMenu script correctly enables the main menu UI and moves the camera, but the assets still disappear.

Screenshot 2025-03-02 214158

Has anyone experienced this issue before? Any ideas on what might be causing the assets to be removed?

Any help would be greatly appreciated! Thanks in advance.

1 Like

Do they still exist on the server? Is workspace.StreamingEnabled on?

Thanks for your reply. I checked Streaming Enabled and it is ON. I also checked if the assets are still on the server and IF they are present.

Turn StreamingEnabled off, or if you want to keep it on, you can use localPlayer:RequestStreamAroundAsync(workspace.CurrentCamera.CFrame.Position)

I have followed both solutions, checking that StreamingEnabled is enabled and calling localPlayer:RequestStreamAroundAsync(workspace.CurrentCamera.CFrame.Position), but the problem still persists.
I also checked that the assets are not being destroyed or removed by another script.
Is there any other possible cause or something else I should check?