According to this reddit post named enums act like dictionaries. So
enum_name.keys()[enum_name.WALK]
should work.
Thanks. I have founded this post too but how could I print the enum from the example below? I have tried without success print("".keys()["".JUMP]) and print(keys()[JUMP]).
enum {
IDLE,
RUN,
JUMP
}
arthurZ | 2019-03-05 01:50
I think that as of 3.1 you have to give the enum a name.
SIsilicon | 2019-03-05 14:20
I’m using godot 3.3.4 and you can still use unnamed enums…
Ghostrix98 | 2021-10-29 11:31
One solution for const enums (unnamed enums) is to create a companion array with the stringnames, i.e.