IsDescendantOf||doc136409

September 20, 2022

Format

Instance:IsDescendantOf(instance)

Describe

Gets whether the instance is a descendant of an instance.

parameter

Variable name Type Describe
instance Instance Instance object

Return value

Type Describe
bool Is it a descendant

Code example

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

print(part2:IsDescendantOf(part1))
print(part3:IsDescendantOf(part1))
print(part3:IsDescendantOf(part2))