Skip to content

Api > MLMirror > GetComponent()


MLMirror.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 MLMirror
local mlmirror;

---@type TComponent
local type;


local val0 = mlmirror.GetComponent(type)

Example⚓︎

local transform = myComponent.GetComponent(Transform);