I was browsing around in the object browser, when I saw a bunch of ancestor functions. What do they do?
COMMUNITY QUESTION
Could someone explain what "ancestor" means in scripting?
2 answers
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.
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'
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
"Ancestor" just refers to a parent of an object. Workspace, for example, is the ancestor of all game parts. Ancestor = parent, descendant = child