I'd like to know if it was possible to consider variable names as strings, in order to make some operations easier and avoid duplicating conditions.
Sometimes like this:
This would allow to avoid duplicating conditions "if GunType=1" "if GunType=2" "if GunType=3" etc. (I don't have many GunType but still, it would be more... clean)
It worked with animations (anim1 anim2 anim3) since the animation name is already considered as a string, so I just had to change the number without converting the variable name into a string. It was extremely convenient, I must admit.
In the example above, I turned the variable name into a string with the str() function but... I didn't work (logically since I converted the variable itself, I suppose). How to "manipulate" a variable name like if it was a string? Is it possible?
Thanks in advance!