Skip to content

Api > MLStation > GetComponent()


MLStation.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 []{Generic : Component info}

Returns:⚓︎

type Description
[]{Generic : Component info}

Usage⚓︎

---@type MLStation
local mlstation;

---@type TComponent
local type;


local val0 = mlstation.GetComponent(type)

Example⚓︎

local transform = myComponent.GetComponent(Transform);