Hi everyone !
I'm trying to change a global variable (of an upgrade) through another node.
I have an upgrade menu in which there are many of them and each have and export variable written as upgrade = "speed_upgrade", or upgrade = "bomb_upgrade". I'd love to have my Global script get that name, find the variable with the same name and update it.
What i'd love is to find a way to transfer the upgrade var from my UI (to know which is selected) to my Global (easy, just have another upgrade var in Global) and then find that variable by name in my Global and update, like this :
Global.upgrade = upgrade
Global.get(upgrade) += 1
Unfortunately, only the first line works (because obviously the second line finds what's stored in the variable and tries to update it... nowhere ?
I hope it's not to confusing. Thanks so much for the time.
Have a good one !
pink