Skip to main content

GameObject.GetComponentsInParent(TComponent type)

Returns all components of Type type in the GameObject or any of its parents.

Parameters:

NameTypeDescription
typeTComponentThe type of Component to retrieve.

Returns:

typeDescription
TComponent[]all components of Type type in the GameObject or any of its parents.

Usage

---@type GameObject
local gameobject;

---@type TComponent
local type;


local val0 = gameobject.GetComponentsInParent(type)