How do you check if a model loaded?

None of the existing posts satisfied me nor did they really work.

4 Likes
if Model then -- if the Model isnt nil (If it exists)
2 Likes

that’s not what i mean. the model doesn’t have time to load from serverstorage

2 Likes

Thats not really true

1 Like

Can’t you just use wait for child?

1 Like

When you parent a model to workspace it doesn’t immediately load

1 Like

i tried this. didn’t work.
devforum stop

1 Like

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

2 Likes

Would you like to explain further? I didn’t quite understand.

1 Like

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

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.