composer.getVariable()

Type Function
Library composer.*
Return value various
Revision Release 2022.3683
Keywords composer, scene, getVariable
See also composer.setVariable()

Overview

Retrieves the value of a variable from within the Composer module that was previously set via composer.setVariable().

Syntax

composer.getVariable( variableName )
variableName

String. The name of the variable previously set via composer.setVariable().

Example

-- Set the Composer variable "money" to 100
composer.setVariable( "money", 100 )

-- In another scene...
local currentMoney = composer.getVariable( "money" )