Skip to main content

LuaBehaviour.StartCoroutine(function coroutineFunction, [optionalArguments] args)

Starts the passed function as a coroutine function.

Parameters:

NameTypeDescription
coroutineFunctionfunctionThe name of the function to be started as a coroutine. Must have at least one coroutine.yield() call with in it.
args[optionalArguments]Arguments to passed as parameters to the coroutine function.

Returns:

typeDescription
CoroutineReference to created coroutine.

Usage

---@type LuaBehaviour
local luabehaviour;

---@type function
local coroutineFunction;

---@type [optionalArguments]
local args;


local val0 = luabehaviour.StartCoroutine(coroutineFunction, args)