News about preload
Out of curiosity, how will I be able to know how many assets are in the queue to preload? Iād like to scale my loading screen based on how many assets I pass into PreloadAsync (I do have plans to go insane by preloading the entire workspace). Should I still use RequestQueueSize?
Essentially what I want to accomplish is this:
- Game states itās loading sounds
- Passes all sounds into PreloadAsync
- When all sounds are preloaded, move on to another asset type
- Repeat until everything I want is done
Now there is no way to get this data. You can still use RequestQueueSize, but it only means the num of assets waiting for download. My suggestion is to break the whole assets into groups and call this function several times. So you can tell the progress.
say I did it like that but for decals just so I can have the image pre-loaded, wouldnāt I need to Destroy every new Decal Object I make or would it be automatically removed after sometime?
Pretty sure theyād be automatically garbage collected if you modify that to set the table variable to nil because there is no parent and all references to the objects are lost. Even if left as-is, the performance impact of just storing simple objects in memory is negligible, even if you have 100s.
One problem: I canāt preload accessories.
You should be able to. Insert them with InsertService, and then preload the SpecialMesh(es) inside the inserted accessory.
Thatās what I did-
I preloaded it, but PreloadAsync got stuck.
I cannot reproduce. Do you have the output open? It might be giving an error or warning thatās causing the script to break and not execute anything past it. If I insert the Soldier model by UristMcSparks from the Toolbox, select the gun mesh, and then run the following code, it preloads just fine:
game:GetService("ContentProvider"):PreloadAsync({game.Selection:Get()[1]}) print("Test")
Is it only that specific mesh thatās broken? If so, can you attach it as a rbxm file here?
I fixed it. Nothing more.