Type Function Library composer.* Return value none Revision Release 2022.3683 Keywords composer, scene, setVariable See also composer.getVariable()
This function sets a variable within the Composer module which you can access from any other scene via composer.getVariable().
composer.setVariable( variableName, value )
String. The name of the variable to set.
String. The value to assign to the variable.
-- Set the Composer variable "money" to 100 composer.setVariable( "money", 100 ) -- In another scene... local currentMoney = composer.getVariable( "money" )