Get display name from enum

Is it not possible to get the display name from an enum? I’m trying to use the enumerator as a place to store values about the character, Hair Color, Eye Color etc. and then I want to simply get the chosen value and display it to a widget but it seems that it’s not possible to get the display name from an enum which is really weird.

This is my enumerator:

And when I try to get display name there are no options:

2 Likes

You can simply cast it to string, that’ll result in the name you set in the enumeration editor.

4 Likes

Thanks for the suggestion. I tried converting it to a string and it wouldn’t. It said it was incompatible.

279465-untitled.png

1 Like

Ahh that’s what happened. I tried to plug it directly into the Text portion of my widget and it gave an incompatible error. Converting to string and then to text fixed the issue. Thank you :slight_smile:

This doesn’t solve the issue if you want FText returned as a type for localisation purposes.

SOLVED THIS ONE
I wanted to use a list I made in an enumerator (text only) and then use those values for socket names.

When in the blueprint and having access to the enumerator value I chose, I needed to:

  1. take the enumerator value
  2. convert it to a string
  3. convert the string to a name

It was the middle step (#2) that was the key.

4 Likes