I have some code which loads images since I'm basically planning to play a video in a GUI. But no matter how I use the PreloadAsync function the images still are invisible for like a quarter of a second after being set as the image property so the video is basically just completely invisible. Anyone know how to properly use PreloadAsync for this idea?
TL;DR How do you properly use PreloadAsync so the images I set in a GUI don't take a while to load when applied so an image animation can be played?
You've asked for the code, here you go
local frames = 302
print("Loading...")
local hahaha = {
}
for i = 1, frames do
table.insert(hahaha, "rbxgameasset://Images/frame" .. i)
end
game:GetService("ContentProvider"):PreloadAsync(hahaha)
print("Starting in 1 second!")
wait(1)
print("Started!")
for i = 1, frames do
wait()
script.Parent.Image = "rbxgameasset://Images/frame" .. i
end

2 comments
In the for loop you forgot the increment?
Which loop?