S
Skortcher
Guest
I have two variables: global.level1 and global.level2. I want to be able to reference both variables using a for loop and writing level = "global.level" + string(i) /* i is either 1 or 2 */ and then converting level which holds a string value into a variable. Thanks for the help.
Mod edit: If you are here from search, this is now possible via variable_global_ and variable_instance_ functions (or asset_get_index for assets), but if you are trying to append a number to a variable name, you should probably be using an array instead.
Mod edit: If you are here from search, this is now possible via variable_global_ and variable_instance_ functions (or asset_get_index for assets), but if you are trying to append a number to a variable name, you should probably be using an array instead.
Last edited by a moderator: