So I have a folder in replicated storage with a bunch of image labels that have the ids of the images I am wanting to preload. I get no errors, but when I join the game and move around, I can see images loading even after they have all supposedly been preloaded. What am I doing wrong?
-- Folders
local world = game.Workspace.World
local loadedAssets = ReplicatedStorage.LoadedAssets
local mainUI = Players.LocalPlayer.PlayerGui:WaitForChild("MainUI")
local assets = {}
for index, asset in ipairs(world:GetDescendants()) do
if asset:IsA("ImageLabel") or asset:IsA("ImageButton") then
table.insert(assets, asset)
end
end
for index, asset in ipairs(loadedAssets:GetDescendants()) do
if asset:IsA("ImageLabel") or asset:IsA("ImageButton") then
table.insert(assets, asset)
end
end
for index, asset in ipairs(mainUI:GetDescendants()) do
if asset:IsA("ImageLabel") or asset:IsA("ImageButton") then
table.insert(assets, asset)
end
end
ContentProvider:PreloadAsync(assets)