Difference between revisions of "Global Command: stopAction"

From The Official Visionaire Studio: Adventure Game Engine Wiki
(Created page with "Stop an active action (an action that is currently being executed). {| class="ts" |- | style="width:15%" | Related functions | startAction |}...")
 
(No difference)

Latest revision as of 12:01, 3 May 2023

Stop an active action (an action that is currently being executed).

Related functions startAction


Syntax

stopAction(action)


Parameters

Parameter Type Description
action TVisObj Visionaire object representing an active action.


Return values

none


Examples

Example 1: Stop an active action.

local myActiveAction = ActiveActions["action_name"]
stopAction(myActiveAction)


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)")