user18910539
user18910539

Reputation:

What does WaitForChild and FindFirstChild mean in Roblox?

Watched several tutorials about these two... What are they even called? Still can't completely understand what they do. Can someone explain it like you would to a non-programmer?

Upvotes: 0

Views: 1392

Answers (1)

Piglet
Piglet

Reputation: 28950

https://developer.roblox.com/en-us/api-reference

https://developer.roblox.com/en-us/api-reference/function/Instance/WaitForChild

Returns the child of the Instance with the given name. If the child does not exist, it will yield the current thread until it does.

If the timeOut parameter is specified, this function will return nil and time out after timeOut seconds elapsing without the child being found.

https://developer.roblox.com/en-us/api-reference/function/Instance/FindFirstChild

Returns the first child of the Instance found with the given name. If no child exists with the given name, this function returns nil. If the optional recursive argument is true, this function searches all descendants rather than only the immediate children of the Instance. Use this function if your code cannot guarantee the existence of an object with a given name.

Watching video tutorials is pointless if you do not refer to a manual.

Upvotes: 1

Related Questions