Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

What is a child? Instance:FindFirstChild

So i just got into scripting and i always see this type of command, but what really is a ''Child''? I can't find any good information that could explain it properly..

1 comment

0

A child is something that is used to get any other objects inside an object.

1 answer

✓ Accepted answer

Hey,

FindFirstChild() will return the first child of an Instance.

So let's say my file tree looked like this...

Part
	- SurfaceLight

If I ran Part:FindFirstChild("SurfaceLight"), it would return SurfaceLight.

You can also use :FindFirstChild() in if statements to see if something exists or not like so...

if Part:FindFirstChild("SurfaceLight") then
	-- run code
end

If this helped, remember to accept and upvote the answer.

This discussion is preserved as it was. New answers, comments, and votes are closed.