This is probably common knowledge, even tho I have like 5 year experience in Roblox Studio, I never realized that you could use
RunService.Heartbeat:Wait()
as a way to wait for workspace to load properly inside StarterPlayerScripts. Atleast from my testing on my end this is true, I want to ask, is it a proper way to wait for workspace to load or is there like an official way I cannot discover for some reason?
Does Game:IsLoaded() exist for this exactly purpose.
Also in what scenario will you need to wait for workspace to load
its a client sided script, so probably a loading screen
3 Likes
game:IsLoaded() does not work for me for some reason, and the RunService way is the only way it does it for me, i dont know why.
Its a scenario where i use CollectionService with for loops and it just doesnt seem to load the assets inside workspace for me.
1 Like
You are essentially doing task.wait() when you run that code. It’s function is not exactly to wait for workspace to load.
4 Likes
Can’t you just DataModel.Loaded:Wait()
?
nope this doesnt work at all. It works more often with RunService but not all the time, so i might have to resort to task.wait() and figure something else out
Alright nvm, I figured out a way to do it. I just put every single instance that hasnt loaded inside ReplicatedFirst, connected functions and then set the parent to workspace. Such a simple solution.
Basically game:IsLoaded()
doesnt wait for workspace so its useless for stuff like this.
Thanks everyone for your replies. <3