Help me understand "ContentProvider:PreloadAsync"

Hello everyone,
I would like to understand ContentProvider:PreloadAsync(param1,param2)'s first parameter.

I’ve come across PreloadAsync topic but didn’t get the assets given to first parameter, are these from Workspace or Asset Manager, but I doubt it’s from Asset Manager but it’s format is not same a assets link from Asset Manager.

I’ve also come across solution on Creating a Loading Bar based off of number of assets loaded, but it is giving an empty array of assets.

What I want to do?
I would like to trigger some changes on loading screen when specific assets from array are loaded…

ContentProvider:PreloadAsync() takes an array of Instances to be preloaded as the first parameter which is the ones you see on the explorer tab, not Asset Manager.

ContentProvider takes an array of Content - a term used to describe rbxassetid:// etc. protocol links, what you’re doing, rbxgameasset:// will work aswell

ContentProvider:PreloadAsync{
  "rbxassetid://1234",
  "rbxgameasset://image",
  "https://www.roblox.com/asset/?id=123"
}

All are valid protocols, here’s a list of valid protocols

  • http/https:// - anywhere on the web, restricted to www.roblox.com and all t0-9 .rbxcdn.com endpoints iirc
  • rbxassetid:// - proxy for above
  • rbxasset:// - local files
  • rbxgameasset:// - asset manager files
  • active:// - temporary loaded animations in Studio
1 Like

Thanks for the reply.
PreloadAsync is the method, so I think you have missed parenthesis, am I right?. I’ll check the code and update this reply…

In Lua, you can use {} instead of () when calling methods.

1 Like