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

I’m still having this issue as well! It’s hurting my players UX.

3 Likes

Bump, this still happens, it doesn’t preload images :frowning:

1 Like

Experiencing this as well, thought I was crazy-Preload API appears to be doing something, but in reality, the textures and audio in my game are still loading as if it’s downloading them

2 Likes

same with me!!!aaaaaaaaa

1 Like

Hi everyone, thank you for your continued patience on this bug. We were able to fix the root cause of this issue in version 583 of Roblox Client/Studio. ImageLabels should now be able to preload properly. However, you will need to pass the ImageLabel to PreloadAsync as an Instance instead of as an asset ID string for it to work. Doing so allows PreloadAsync to use more specialized loading that is specific to the type of Instance passed to it, making it work more reliably (see ContentProvider:PreloadAsync and Preload update). Sorry for the lack of clarity on this API - we will be updating the documentation to more accurately reflect the expected behavior of PreloadAsync.

Preloading ImageLabels as Instances should no longer create a “flash” as shown in this repro. Due to another issue that the repro helped us discover, the ImageLabel’s isLoaded value may be incorrect when checked right after PreloadAsync is called. We are still working on fixing this, but ImageLabel preloading should now be working properly even if the isLoaded property seems to indicate otherwise.

Thank you @Quenty for providing such a clear description and repro for this bug; they helped immensely! If this issue is still occurring, please create a new topic for us to look into.

9 Likes

Thank you so much for finally addressing this! My game heavily relies on this feature and it’s so awesome to see it be fixed. :smile:

If you could let us know when the documentation is updated, it’d be highly appreciated. :+1:

Just a quick query; would creating an ImageLabel, setting the image ID, invoking the :PreloadAsync() function on it, and then destroying it allow that same image ID to be used with other images that are newly created in the game? Surely it doesn’t just load the image object you call it on, right?

1 Like

Just to clarify, you’re not required to use an ImageLabel to preload an image asset, correct?

There’s plenty of other instances that contain texture properties, such as Decals, SpecialMeshes, Shirts, SurfaceAppearance, etc.

Just a quick query; would creating an ImageLabel, setting the image ID, invoking the :PreloadAsync() function on it, and then destroying it allow that same image ID to be used with other images that are newly created in the game? Surely it doesn’t just load the image object you call it on, right?

Yes, this should work if the preloaded object and the new objects are the same Instance type (for example if they are all ImageLabels). One thing to keep in mind is that the image texture may be garbage-collected from the cache if there is a long period of time between the deletion of the preloaded object and the creation of the new ones.

Just to clarify, you’re not required to use an ImageLabel to preload an image asset, correct?
There’s plenty of other instances that contain texture properties, such as Decals, SpecialMeshes, Shirts, SurfaceAppearance, etc.

Correct, preloading images in other instances should also work when the instances that contain them are passed to PreloadAsync. However, preloading SurfaceAppearances is not currently supported

4 Likes

This topic was automatically closed after 6 days. New replies are no longer allowed.