IsAncestorOf||doc136408

September 20, 2022

Format

Instance:IsAncestorOf(instance)

Describe

Gets whether the instance is the ancestor of an instance.

parameter

Variable name Type Describe
instance Instance Instance object

Return value

Type Describe
bool Is it an ancestor

Code example

local part1 = Instance.new("Part")
local part2 = Instance.new("Part", part1)
local part3 = Instance.new("Part", part2)

print(part1:IsAncestorOf(part2))
print(part1:IsAncestorOf(part3))
print(part2:IsAncestorOf(part3))