Skip to content

Api > GameObject > GetComponentInParent()


GameObject.GetComponentInParent([]{Generic : Component|info} type)⚓︎

Retrieves the component of Type type in the GameObject or any of its parents.

Parameters:⚓︎

Name Type Description
type []{Generic : Component info}

Returns:⚓︎

type Description
[]{Generic : Component info}

Usage⚓︎

---@type GameObject
local gameobject;

---@type TComponent
local type;


local val0 = gameobject.GetComponentInParent(type)