So, my game is made up of a LOT of images. The way I load every single image is looping through all of PlayerGui, then make a new ImageLabel for every image I have in the game and storing that new label in the top left corner, barely visible, so it’s loaded for the entire time the player is playing.
This has worked perfectly for about 10 months, until recently I noticed that even though every image in my LoadingContainer (the place I store all these loaded images) says .IsLoaded is true, the image isn’t actually loaded because it flashes when its first showed on screen.
If this didn’t make sense, just watch the video.
Notice how when I put the monitor up or put the freddy head down, it either flickers heavily or won’t show up until the last frame. This is just an inconvenience to players, as they expect images to look good and not flicker like that.
Another point, when I select every image that was loaded while in game, it says that .IsLoaded is true for every single one.
I have seen the same kind of flashing before, for example in a gun system that always flickers the first time a weapon is equipped, but that behavior only shows up in Studio. Once the game is published and running in the live environment, it does not happen.
Are you sure this isn’t just a studio thing..
Once had a hair object on an animated NPC that would not stop flashing. Tried everything to fix it to no avail. In the end, I placed a clone of the object in a spot next to the NPC where it could not be seen. The hair flashing fixed itself after that (clearly a not loading fast enough atm thing).
Had a car problem once flashing on me when cloned into the game.. fixed that with PreloadAsync.
Hello! While preloading images can help reduce loading delays, it’s nearly impossible to guarantee that all images will load smoothly before they’re first displayed. In Roblox, images typically load the first time they appear on a player’s screen rather than in advance. The “flicker” you mentioned is likely caused by the image loading process itself. This can happen for several reasons Roblox may temporarily unload assets to optimize memory usage, or it might be due to a high ping or an unstable internet connection.
At this point, I’m pretty sure that when .IsLoaded is true, it only means the asset data has been fetched from Roblox’s servers, not necessarily that the texture has been uploaded to the GPU and is ready to draw. If you force a draw somewhere unseen, it starts working perfectly. This is why I’ve come to that conclusion.
Probably, the .IsLoaded should mean that its loaded on the server itself not the client. You can maybe test this by booting a client instance after the server loaded and make it print if it detects any changes in proprieties.
I get how the flicker works, which is why I designed the loading screen to be how it is. This worked for months until recently, when the images would flicker, despite me not changing the code at all. This leads me to believe Roblox changed something, or there’s some kind of new setting.
This might be because the studio is loading the server and the client at the same time, this might not be as bad on the roblox app since it doesn’t need to load every plugin and every service studio has
PreloadAsync doesn’t work for me, and I essentially am cloning the image and putting it in a place that cannot be seen.
This is the code I use to create a clone on every image in the PlayerGui to preload it:
The second line is very long but it just figures out if the “thing” is an image or stringvalue that needs to be loaded.
for _, image in images do
if not image:IsDescendantOf(loadinggui) and (image:IsA("StringValue") and (image.Value:find("rbxassetid://") or image.Value:find("roblox"))) or ((image:IsA("ImageLabel") or image:IsA("ImageButton")) and image.Image ~= "") then
local label = Instance.new("ImageLabel")
label.Size = UDim2.new(0,1,0,1)
label.ImageTransparency = 0.99
label.ImageColor3 = Color3.fromRGB(0,0,0)
label.BackgroundTransparency = 1
if image:IsA("StringValue") then
label.Image = image.Value
else
label.Image = image.Image
end
label.Parent = container
--while not label.IsLoaded do runservice.Heartbeat:Wait() end
end
COMPLETED.Value += 1
end
Once again, this has worked for almost a year now. There isn’t a problem with the code, and when it did work, it worked in both studio and in game.
It could be a problem because of the amount of images that it needs to load. Did you add a lot more assets overtime or something? It could also be because of high resolution images.