Global Command: startAction

From The Official Visionaire Studio: Adventure Game Engine Wiki
Revision as of 11:55, 3 May 2023 by EK (talk | contribs) (Created page with "Starts an action. {| class="ts" |- | style="width:15%" | Related functions | stopAction |} == Syntax == <syntaxhighlight lang="lua"> startAct...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Starts an action.

Related functions stopAction


Syntax

startAction(action)


Parameters

Parameter Type Description
action TVisObj Visionaire object representing an action.


Return values

Type Description
TVisObj The Visionaire object representing the active action.


Examples

Example 1: Start an action.

local myAction = Actions["action_name"]
startAction(myAction)


Example 2: Start an action and stop it after a certain time, depending on a Visionaire value called "duration" holding the amount of seconds.

local myDelay = Values["duration"].Int
myActiveAction = startAction(Actions["action_name"])

setDelay(myDelay * 1000, "stopAction(myActiveAction)")