ContentProvider:PreloadAsync and Preload update

To enhance asset type safety, ContentProvider:PreloadAsync function now works with instance list. It will gather asset ids from instances and their children recursively.

An example : ContentProvider:PreloadAsync({ game.Workspace.Model1, game.Workspace.Part1})

If you pass in id strings (the old way), those ids will be assumed as images, other types will failed to request. This will cause some error messages printed out. Edit: Sorry for the trouble I caused today. I’ve turned this off. Now you can take your time to make an update.

Edit: I’ll enable it Aug 31th. And we will deprecate ContentProvider:Preload function in the near future. The only recomendation for preload will be ContentProvider:PreloadAsync with instances.


This is awesome, thanks!

1 Like

Uh oh, so audio preloading with asset urls will fail - Not severely game-breaking, though games that used it that way may want to update their code now. :thinking:

1 Like

Considering my game is loaded with audio files around the game and images. This is great, I don’t have to make a giant list of Ids.

Will we need to preload audios as in-game assets rather than IDs now?

1 Like


1 Like

Wait what’s the difference between IDs and in-game assets? I don’t think i’ve used an ‘in-game asset’, I’ve always used the the URL-like string for defining ImageLabel.Image, sound.SoundId, decal.Texture, is that what an ID is?

1 Like

So now we can preload unions? That’s awesome.


Is this live?

Really bugs me how sound IDs don’t preload now. Each of my weapons has a module with the weapon sound IDs and now I can’t peload them :\


And this is meaning we can preload unions now? Description is kind of vague… Cuz that’s awesome, preloading is essential…

An id is a URL-lilke string. A instance means a game object that have an asset id as a property. This function will check different types of object and get asset id from them.

You can create some Audio objects in script with your original ids and pass them to the function.

ah ok to preload sounds

local SoundObject = Workspace.SoundObject
SoundObject.SoundId = "URL-like string"


That’s how it’s done now I think


Isn’t that kinda counter productive tho? I don’t want to create excessive audio instances until I need them


Out of curiosity, how was this being abused? Were users preloading places or something?

Please tell me this is a warning and not saying it is about to go live. I need to redo a lot of my loading screen in Ultimate Boxing or I will get a lot of complaints of long loading times.


Its already live, got errors in my game so I had to turn of preloading by soundId


It’s not really related to this function. We added type check to asset requests. So by getting asset ids from instances, client will know what type of asset it is.


Fix it! Easy fix, so no need to fret :P

function preloadSoundsById(soundIdList)
    local soundInstances = {}

    for _,soundId in next,soundIdList do
        local soundInstance ="Sound")
        soundInstance.SoundId = "rbxassetid://"..soundId
        table.insert(soundInstances, soundInstance)