Good or bad practice to loopcall InsertService:LoadAsset() upon failure?

I want to load game-critical assets using InsertService. I am aware that InsertService may fail sometimes. In the case that InsertService fails to return my asset, should I redo the call after a few seconds, or is that pointless? The assets I will be loading all belong to my account, so the only potential cause of InsertService failing would be if the Roblox servers were having issues.

I will have a generic fallback item to take the place of the requested asset, not that it matters.

There’s nothing wrong with calling InsertService again if your have it wrapped in a pcall and it errors. I am assuming you’re using a pcall function, which means you always could set a maximum number of tries to load an asset some arbitrary number like 10, and if the asset hasn’t successfully loaded after those tries just insert a placeholder. However, you also could just continuously keep trying to load an asset and only replace a placeholder once the asset is available. The second option is normally how I would go about it since, like you said, there shouldn’t be a reason that it fails.

2 Likes

This is my first time working with InsertServices and there isn’t much discussion about accepted practices. Thanks. I’m just not sure if there will ever be a situation where the asset servers go down for a brief moment and come back right away; I feel like if InsertService were to fail, it would continue to fail for a prolonged period like a few minutes to a few hours.

1 Like