MLSpeaker.GetComponent(TComponent type)
Returns the component of Type type if the game object has one attached, nil if it doesn't.
Parameters:
Name | Type | Description |
---|---|---|
type | TComponent | The type of Component to retrieve. |
Returns:
type | Description |
---|---|
TComponent | the component of Type type |
Usage
---@type MLSpeaker
local mlspeaker;
---@type TComponent
local type;
local val0 = mlspeaker.GetComponent(type)
Example
local transform = myComponent.GetComponent(Transform);