I’m tried a million different things to get 150 images to be preloaded.
I’ve got them in a list:
ContentProvider:PreloadAsync({List})
I’ve tried creating them all manually
ContentProvider:PreloadAsync({LoadingUI.Animation})
-- and
ContentProvider:PreloadAsync({LoadingUI.Animation:GetChildren()})
None of these work. When I play the game, and I try to loop through all the images, they do not appear
local AllImages = {}
for _, v in pairs(LoadingUI.Animation:GetChildren()) do
AllImages[tonumber(v.Name)] = v
end
ContentProvider:PreloadAsync({LoadingUI.Animation})
for i, image in ipairs(AllImages) do
image.Position = UDim2.fromScale(0.5, 0.5)
-- Hide Last Frame
if PrevImage then
PrevImage:Destroy()
end
PrevImage = image
task.wait(1 / 42)
end
It’s supposed to work as a slideshow, but instead I see nothing. The images ARE NOT loading in. I NEED them to be fully loaded and visible, before this loop runs, so when it loops through them, you can actually see them. Instead, depending how fast the game loads, I either get a screen with nothing showing (images haven’t loaded) or I get glitching, where a handful of the images have loaded, but not all of them
GetChildren() returns a table, so no need of them to be in a table,
also put PreloadAsync in a loop.
local AllImages = {}
for _, v in pairs(LoadingUI.Animation:GetChildren()) do
AllImages[tonumber(v.Name)] = v
end
print('Preloading started')
for i,v in next, LoadingUI.Animation:GetChildren() do
ContentProvider:PreloadAsync({v})
end
print('Preloading is now done!')
for i, image in ipairs(AllImages) do
image.Position = UDim2.fromScale(0.5, 0.5)
-- Hide Last Frame
if PrevImage then
PrevImage:Destroy()
end
PrevImage = image
task.wait(1 / 42)
end
PreloadAsync doesnt load anything faster, it actually depends on our internet connection preloadasync actually make things that you want to load first, I think theres a property called “IsLoaded” in image you can check if the image is loaded or not by using it.
I was under the impression this is what PreloadAsync fixes and would make sure whatever’s inside it would be 100% fully loaded and ready before moving down the script
Hi, I apologize for reviving this old thread, but I’m curious if you ever found a solution?
We’re currently dealing with hundreds of frames to create on-screen animations, since using videos aren’t an option as RGBA is not yet supported. We also can’t use SpriteSheets because the resolution is far too small.
Our workaround has been to preload every frame and toggle visibility while keeping them hidden beneath other UI elements. It seems as though IsLoaded never fires unless the frame is visible.
Unfortunately, this approach is causing significant lag and is no longer sustainable for us.
Only way I was able to get it to work was by placing every image on a part in front of the player’s view when they join the game. Our game is 2D so this worked out fine because the screen is always covered with a UI but is not ideal and does not always work if a player has a poor connection.