Skip to main content

Light.GetComponent(TComponent type)

Returns the component of Type type if the game object has one attached, nil if it doesn't.

Parameters:

NameTypeDescription
typeTComponentThe type of Component to retrieve.

Returns:

typeDescription
TComponentthe component of Type type

Usage

---@type Light
local light;

---@type TComponent
local type;


local val0 = light.GetComponent(type)

Example

local transform = myComponent.GetComponent(Transform);