Skip to main content

GameObject.AddComponent(TComponent componentType)

Adds a component class of type componentType to the game object.

Parameters:

NameTypeDescription
componentTypeTComponentcomponent type

Returns:

typeDescription
TComponentAdded Component

Usage

---@type GameObject
local gameobject;

---@type TComponent
local componentType;


local val0 = gameobject.AddComponent(componentType)