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.
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.
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?
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.
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.
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.
function preloadSoundsById(soundIdList)
local soundInstances = {}
for _,soundId in next,soundIdList do
local soundInstance = Instance.new("Sound")
soundInstance.SoundId = "rbxassetid://"..soundId
table.insert(soundInstances, soundInstance)
end
game:GetService("AssetService"):PreloadAsync(soundInstances)
end