AddComponent
7/14/25Less than 1 minute
GameObject.AddComponent(TComponent componentType)
Adds a component class of type componentType to the game object.
Parameters:
| Name | Type | Description |
|---|---|---|
| componentType | TComponent | component type |
Returns:
| type | Description |
|---|---|
| TComponent | Added Component |
Usage
---@type GameObject
local gameobject;
---@type TComponent
local componentType;
local val0 = gameobject.AddComponent(componentType)
