Topic was automatically imported from the old Question2Answer platform.
Asked By
bobokox
Old Version
Published before Godot 3 was released.
Hey!
Is it possible to access a global var by defining its name with a string var?
something like this:
export var type = "coco"
#### global.+str(type) += 1
and it should do the same like this:
export var type = "coco"
if type == "coco": global.coco += 1
if type == "bana": global.bana += 1
if type == "mang": global.mang += 1
if type == "ston": global.ston += 1
if type == "wood": global.wood += 1