How to know an asset has been loaded

usually when theres problems when loading an asset fully it will print out an error like

“Failed to load sound rbxassetid2032302323232 Unable to load sound data”
now if it loaded how to print it out?

You can use ContentProvider:PreloadAsync to preload the sound. This will either print an error in the output if assest has failed to load, and vice verca (I think).

1 Like

i mean if in any situation I have to find every asset existing in the place and then listing them into a table like what the devhub PreloadAsync would that cost many lines in the script?

local assets = { thumbLeft, thumbRight,a,b,c,d, -- goes on until who knows how long }

I’m haven’t done so in a while so I’m not entirely sure. I think you just have to make do.

I suppose if you don’t want to list the assest individually, you can create a table with all of the assests in a specific place, say for example Replicated Storage, use a for loop though the table and call Preload Async on it.

This line: local assets = { thumbLeft, thumbRight }

Why not just have a table with all the assest, and this line would just call that?
I don’t think you should do it all at once though. Maybe iterate through each assest one by one but within the table.

1 Like