Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Could someone explain what "ancestor" means in scripting?

Asked by 5 years ago

I was browsing around in the object browser, when I saw a bunch of ancestor functions. What do they do?

0
"Ancestor" just refers to a parent of an object. Workspace, for example, is the ancestor of all game parts. Ancestor = parent, descendant = child whenallthepigsfly 541 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago

An ancestor of a part simply means the parent of the part. So, if a particle effect's parent is part, the fire's ancestor is part.

Ad
Log in to vote
0
Answered by 5 years ago

An ancestor of an object is like the opposite of the children of an object. For example, a part in 'Workspace' has the ancestors 'Workspace' and 'game'.

local part = Instance.new('Part', workspace)
print(part:FindFirstAncestor('Nonexistant')) -- Prints nil
print(part:FindFirstAncestor('Workspace').Name) -- Prints 'Workspace'

Answer this question