Where should I preload a large list of assets?

:wave: Hello!

I’m needing to preload a list of assets.
I’ve seen many tutorials on how to do this - I’m simply wondering where the best location would be to do this.

For example, I see Workspace often mentioned in tutorials, however, I want to reduce clutter.

I have everything in a Folder like this:

image

Then, a LocalScript in ReplicatedStorage:

game:GetService("ContentProvider"):PreloadAsync(game:GetService("ReplicatedStorage").PreloadAssets:GetDescendants())

Any help or feedback would be greatly appreciated! :slightly_smiling_face:

1 Like

Everything in ReplicatedStorage gets loaded by the client, you don’t need to preload anything that’s in the Workspace, or ReplicatedStorage.
Preload is meant for literally pre-loading content.
Before the client has access to the content, you should preload its assets. Once loaded, then transfer to the client.

I didn’t expect to need to explain why I need to preload:

Here’s one example; I have an image that changes to one of 5 randomly every few seconds. If not preloaded, then it goes invisible until it’s loaded by the client.

I tested this but it didn’t work. Maybe I’m misunderstanding?

2 Likes

Put the local script in replicated first Scripts in rep storage dont work.

1 Like

There’s currently a bug report from just this week that users are experiencing problems preloading assets. This may be a temporary issue, worth following that bug report.

1 Like

I also experience the same issue a lot, even after preloading with ContentProvider. So I usually fix this by placing ImageLabels that are visible underneath a frame (with the same background color as the main background) for each image that I don’t want to experience the issue with. So once I use these images at any time, they instantly appear.

For sounds and animations though, there’s no workaround for them. We need to wait until roblox patches this bug.

Have you tried using ReplicatedFirst instead of ReplicatedStorage? I believe it works there, as this is the area where everything can be preloaded.

I’m unsure if its buggy right now, however I usually preload everything in ReplicatedFirst. Hope this helps!
(Probably late to this)