ContentProvider:PreloadAsync() does not preload image or texture assets in either assetId form or instance form (appears to be a regression)

Reproduction Steps

Steps (done in a script attached)

  1. Call ContentProvider:PreloadAsync({assetId})
  2. Set image label image to asset id
  3. Set image label visible to true
  4. Expected result: Image is preloaded, there is no white background or flash, the method yields until loaded
  5. Actual result: Image is not preloaded, IsLoaded property is false

Video of result, see flash:

ContentProvider_PreloadAsync_DoesNotWork.rbxl (35.1 KB)

NOTE: You need a new image each time you do this, one from the website, NOT from studio, otherwise images will be in the cache. Alternatively, you can clear the cache to reproduce this.

However, preloading works for animations and sounds.

Reproduction / system info

Note that your cache must be clean for this to reproduce (obviously once it’s loaded, preloading doesn’t do anything).

  • Happens on Windows 11
  • Happens in Studio and Game
  • Intel i5-8600 3.60 Ghz, GTX-1080
  • Happens on multiple people’s computers

Why this is important to fix

This is very important because many first-time experiences for users includes images for buttons, tutorial information, and more. Without these images rendering, it can be very hard to draw the eye to the correct instance, and ensure that first-time user experience is good.

Expected Behavior

  1. ContentProvider:PreloadAsync() yields until all images are loaded
  2. Images in image labels set to those images’ will be shown immediately

Actual Behavior
The image does not preload. See above.

Workaround
You can create image labels, and parent them, and then listen to IsLoaded event. However, this is probably a bad way to preload images. Also, it will not work as well with textures in the world space.

Issue Area: Engine
Issue Type: Other
Impact: Moderate
Frequency: Constantly
Date First Experienced: 2022-01-20 00:01:00 (-08:00)
Date Last Experienced: 2022-01-20 00:01:00 (-08:00)

57 Likes

I’d like to bump this because it seems like the issue has spread over to animation preloading as well, I’ve noticed that the animations on my games characters play with a noticeable delay for the first time (which shouldn’t be happening when they are preloaded)

7 Likes

I was confused as to why my game had not been loading properly, despite me clearly having implemented preloading properly. I spent a good couple of hours figuring out the issue before giving up :upside_down_face:
This is a very major bug, especially to games that rely on things such as cutscenes or UI that they must make 100% sure to be loaded before showing.

6 Likes

Thanks for the report! I have filed a ticket.

10 Likes

Not all heroes wear capes. Thank you!

8 Likes

I’m aware this issue is now being tracked (thanks to the awesome DevRel staff!), but I’d just like to point out just how annoying this can get:


My bandwidth is pretty decent, which allows for the menu to load properly before the cinematic ends - but for some players with lower bandwidth, they may not even see the menu before it finishes!

11 Likes

Is this still happening? And any fixes for it?

2 Likes

Yep, this is still happening, was looking for this type of post.

I’m glad a ticket was filled at least.

2 Likes

No wonder my images were not pre-loading in any of my games. I really need this fixed, why has it taken over 6 months?

5 Likes

any updates on this issue? it still seems to be happening to me and my game has a few effects that utilize image animations and having those assets just pop in to existence looks very ugly.

4 Likes

Still happening.

Attempting to Preload SurfaceGui Images by AssetId before they’re seen in the world to no avail.
Hacks don’t seem to do anything for this situation.

AssetIds don’t appear to load when not .Visible or when .ImageTransparency is 1

3 Likes

I seem to have found a Solution!

See, if you set the ImageTransparency to 1 it won’t load, but if you set it to 0.999 it will load, still pretty much invisible. This works for me, tell me if you have any problems.

There is really no way to make the loading faster, but if we preload them i hope it gives you the effect you want.

5 Likes

This is still an issue and breaks the core promise of ContentProvider:PreloadAsync. Nothing I pass through that function should appear to “flash” in the way described in the OP. While there are special case workarounds, this should just work.

5 Likes

Would like to bump this, it’s very frustrating!

5 Likes

This is still occurring. The creator hub docs are also misleading because they use an image asset in the code example. This needs to be fixed. Has the ticket from nightend16 been pushed forwards at all? I know there’s a lot of bug fixing/UX improvements happening @ Roblox right now, this would be great to get fixed.

3 Likes

I agree, this should be very high priority as it affects almost EVERY game thats live right now, players are wasting their time waiting for “assets loading” screens thinking it actually does something, only few games have a “skip loading” button and even less players use it

3 Likes

Would also like this pushed forward to Roblox as well. It’s really annoying. I thought I was implementing the preloading wrong but it seems that’s not the case. Glad to see it’s a known issue, but I would rather see it not be an issue in the first place.

4 Likes

It’s disappointing this issue is still prominent years after it was reported. This method doesn’t even do what it’s supposed to.

An official response from an engineer or DevRel member would be appreciated.

3 Likes

I’m going to bump this even further.

My game has been suffering aesthetic-wise because of this issue. The images take a while to load, sometimes even like 3 seconds and it’s so frustrating!

1 Like

Also having issues with this and can hopefully get some more optics on it. PBR textures with preload async does not work at all and you end up with greybox levels.

3 Likes