None of the existing posts satisfied me nor did they really work.
if Model then -- if the Model isnt nil (If it exists)
that’s not what i mean. the model doesn’t have time to load from serverstorage
Thats not really true
Can’t you just use wait for child?
When you parent a model to workspace it doesn’t immediately load
i tried this. didn’t work.
devforum stop
If you’re talking about the model instance loading, on the client you can check if it’s loading by:
local Model = workspace:FindFirstchild("Model")
if Model then
--its loaded
else
--its not loaded
end
Or you can do
local Model = workspace:WaitForChild("Model")
--Will execute once the model has loaded but will yield the current thread
Or if you are talking about the textures/assets/resources contained in the model use what @TestAccount563344 said above
Would you like to explain further? I didn’t quite understand.
If you’re wondering how to do it:
game:GetService("ContentProvider"):PreloadAsync(path:GetDescendants())
It’ll yield until the model loaded.
EDIT: That is not really true. it will only preload assets (images, sounds etc)
so instead, to make sure the model loads on the client you should probably use WaitForChild(model) which usually yields enough for most of the model to replicate to the client, then you can use preloadasync. if you want to go extra, you can call waitforchild on its descendants, though it’s gonna take way longer to load, and even then this is useless because PreloadAsync yielding and preloading will absolutely lead to the full model replicating
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.