Retrying asset loading
Actually @xyrafrost, this may surprise you, but there is an undocumented way to retry assets that have failed. The reason why trying to load an asset again will fail is because the URL is cached in Roblox’s cache.
For simplicity, rbxassetid://[id]
actually just expands to: https://assetdelivery.roblox.com/v1/asset?id=[id]
internally.
If you were to put something after it, say, rbxassetid://[id]&retry=1
, then it is a different URL, now being https://assetdelivery.roblox.com/v1/asset?id=[id]&retry=1
, which is not cached by the client.
So, therefore, you can automate this with a script. If you detect that an asset has failed to load, you can retry with rbxassetid://[id]&retry=1
, rbxassetid://[id]&retry=2
, rbxassetid://[id]&retry=3
, etc. Like others were saying, if you do decide to go this route, I’d suggest putting a limit on how many times it will retry. If you try 10 times to load the asset and it fails to load, then it’s safe to assume that even if you try a million more times, it still won’t load. Use this knowledge wisely and try not to misuse it like this.
Here, I unplugged my Ethernet for about 40 seconds, tried to load rbxassetid://144080495
, and it failed (obviously). I plugged the Ethernet cable back in and retried with rbxassetid://144080495&chepsk9washere=1
(oops, accidentally misspelled cheapsk9, haha), and you can see the Request URL in memory (I scanned Roblox Studio’s memory for chepsk9washere=1
for demonstration purposes only.)
Detecting asset loading failures
As for @RuizuKun_Dev, I saw your other thread (Give us a way to tell when an asset failed to load) saying it was impossible to detect when assets couldn’t load. This isn’t true; you can check by ContentProvider:PreloadAsync(contentIdList, callbackFunction)
if it hasn’t loaded using a callback function. Since normal asset IDs won’t retry reloading as I’ve mentioned earlier, if you try to preload it after it has failed, it will also return a failure status. Remember earlier when I unplugged my Ethernet cable, and tried to load that one asset? Well, I tried loading it again with ContentProvider in the command bar, with print as the callback function, and sure enough, Enum.AssetFetchStatus.Failure
.