I have developed a constant fear that if I do not use waitforchild on every single thing that it will error because it isn’t created yet.
so my question is, when I clone something, are all descendants loaded in before any other code is ran? so if I had a part in a model would it ever not be before I reference to it after cloning the model
If there was a part in a model I cloned, and I were to change it’s color right after cloning, would it ever error because the part wasn’t loaded in yet? Or do parts/descendants always load in instantly, or atleast pause the code until it does load in.
I used to do the same thing, use wait for child’s everywhere.
But after getting more familiar with the language and how Roblox works, I tried to understand when it should be used and when it shouldn’t
In your case, a clone with scripts inside… of course the scripts parent is there, but as for children of the scripts parent or other things in the cloned object, I would probably check to make sure the script didn’t replicate and start to run first. But this might be overkill. Have you tested out to see if this ever happens?
I would feel it would be logical that before the cloned object could exist in an area where the script could run, it would have all its parts.
Probably where it might be an issue would be with replicated objects, such as sent from server to client. Or if certain things are streaming in as you get close to them, the script might fire before the objects, but I’ve never tried any of those out.
I’m just saying in general, if I were to clone a model and change a parts color in it without using waitforchild and no waits, could there be a chance that part isn’t loaded in yet, resulting in the error that it isn’t inside the model yet