Api > GameObject > AddComponent()
GameObject.AddComponent([]{Generic : Component|info} componentType)⚓︎
Adds a component class of type componentType to the game object.
Parameters:⚓︎
Name | Type | Description |
---|---|---|
componentType | [ |
info} |
Returns:⚓︎
type | Description |
---|---|
[ |
info} |
Usage⚓︎
---@type GameObject
local gameobject;
---@type TComponent
local componentType;
local val0 = gameobject.AddComponent(componentType)