Is there a way to get the amount of Instances that DataModel:IsLoaded() waits for?
and is there a way to get the amount of Instances that have loaded out of the total amount?
I have this code
repeat
print('Game Is Loading')
wait()
until game:IsLoaded()
To clarify something: there is no way to check how many instances the client is waiting for. All that replication logic is internal. IsLoaded tells you when the server has finished initial replication to the client, but it doesn’t give you any numbers.
ContentProvider is what you can use if you want to prioritise an asset to be downloaded or make it download in the priority queue if it hasn’t been used at least once in the game, however this pertains to assets from the CDN, not to instances. That’s stuff like shirts, pants, audio, whatever.
When it comes to parts, only non-primitives will get downloaded, so that’s MeshParts and UnionOperation parts (Unions are uploaded as an asset to the website and must be downloaded). Anything else falls under general replication and does not need any downloading done for it, thus PreloadAsync on a model with no assets is meaningless.
You can check the preload handling process by going through a table of instances one-by-one and passing them as a single-entry table to ContentProvider, but zeuxcg spoke against doing this a bit ago. See this post for more information:
If you ever use PreloadAsync, never pass your entire game through it. PreloadAsync is only meant, as the name of the method states, to prioritise something in the download queue. If you prioritise everything, it’s the same as prioritising nothing. PreloadAsync should only be used for assets that the client should immediately see (loading screen icons, menu textures, so on).
You can also put models in ReplicatedFirst if you want them to be the first things replicated to the client, however the instances here are only available to the client, they aren’t replicated back to the server.