'WaitForChild' will wait for the object even after timeout reached

It’s really in the title. If you run a game, wait for a child, wait for the timeout warning to be given and then parent it, the script will run from that point.

I can’t tell if this is intentional behaviour or just a glitch. This happens regardless of if the timeout is reached so I suppose it is a glitch.

I think this is normal behaviour:

As I thought, the warning only happens after 5s if you don’t specify the timeout argument (and it didn’t find the child yet). If you actually give it a number, it won’t give the warning, even if WaitForChild yields longer than 5s. (if it takes longer than the timeout you specified, it just returns nil)

It’s basically a warning saying “You’re still waiting for something after 5 seconds, is this right?”. If you specify the timeout yourself, Roblox is just like “Eh, he specified a time, it’ll be fiiiiine”.

Just for confirming stuff and fun, I also did a WaitForChild(“sdf”,600) before I started writing this. After more than 2m, still no warning from that one.

3 Likes

If you’re talking about the case where you don’t specify a timeout, that’s intended yes. Infinitely waiting WaitForChilds are needed for backwards compatibility and I guess it could be useful in some cases over a ChildAdded wait loop, they just give the warning because it’s arguably bad practice when you’re doing a possibly infinite yield.

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