Api > AudioSource > GetComponent()
AudioSource.GetComponent([]{Generic : Component|info} type)⚓︎
Returns the component of Type type if the game object has one attached, nil if it doesn't.
Parameters:⚓︎
Name | Type | Description |
---|---|---|
type | [ |
info} |
Returns:⚓︎
type | Description |
---|---|
[ |
info} |
Usage⚓︎
---@type AudioSource
local audiosource;
---@type TComponent
local type;
local val0 = audiosource.GetComponent(type)
Example⚓︎
local transform = myComponent.GetComponent(Transform);