Why does Switch on Enum > promotes variable to byte ...

10177-captureenumbyte.png

For the Selection input of a Switch on SomeEnum, if I right-click and choose Promote to Variable it creates it as a byte, not as a variable of the type SomeEnum. To change this I have to delete the new variable in the eventgraph, change the variable type in Details panel, and then drag it onto the graph as Get to pin onto Selection again.

Why not just make Promote to Variable create the new variable as a type used for that Switch on SomeEnum in the first place?

Tom

But the Byte IS the variable of your enum. An Enum is a {key:value} pair where the key is alway a byte. Switch needs a number, not a string, and this is a good thing for performance purposes. Also, if you have an enum variable, you can create a get node and drag off “to name” or “to string” to get the text value of the enum.