How to properly use ContentProvider?

You can correct me if this is the wrong category, but here goes.

How exactly does one use ContentProvider outside of just creating a more accurate loading screen? I have a script that preloads assets with it and uses that to make a loading screen, but once an asset is preloaded, does it need to be cloned and used elsewhere, or is it good as soon as it’s loaded?

1 Like

Usage of API depends on your use case. Without one, it’s not exactly easy to determine what may be a proper use case for ContentProvider’s preload API. In general though, you typically want to reserve this to load up assets that you’d like available as quickly as possible.

When an asset is preloaded, it is actually added to the download queue (if it’s already in there, it’s moved to the front). This then allows the client to download an asset so that when it get used and it’s downloaded, it’ll display immediately. Any asset used for the first time must be downloaded, hence why you might not see or hear everything immediately from unions, decals, meshes, sounds and so on.

An asset does not need to be cloned and used immediately after preload. Once you call preload on that asset and it’s been downloaded, it’s good to go right away.

1 Like