Hi all! It's one of those rare questions I have. Say if I have a model in ServerStorage, and I clone it, parenting it to Workspace. Obviously, it won't just pop up right away, it'll load part by part (considering it's a large model, such as a map). Is there a pre-set function or property I could use to tell when it's finished loading? I've noticed in several games, they've cracked the nutshell on how to do this, but sadly I can't. Any ideas?
Thanks in advance.
Well, there's two fundamental issues to tackle here, so let's get to that.
The content queue.
You remember that good old guide you've probably looked at once upon a time explaining how to make a custom loading screen? Well, the same applies here: By using the ContentProvider.RequestQueueSize
, you can tell when there's no more parts streaming in to the client. This is super useful for you, by the way.
Replication
Why do you have to move it from ServerStorage to the client right at that moment? Why not put the stuff in ReplicatedStorage and either have the client clone it or let the server move it. Either way, it can be replicated ahead of time.
To best explain this idea, consider that you have a minigame system. At the end of the round, a new map is chosen, and at the start of the new round the map is cloned in. If you choose the map ahead of time, you can get the map replicated (via ReplicatedStorage) and ready whilst people are playing their minigames, which reduces any loading times phenomenally by removing the waiting times from replication.