String to Enum blueprint

Hello,

is it possible to select from a String an enum, so that I give a String and get an enum in blueprint?

Thanks. Jojii.

You could try Set Value as Enum, but I’m not sure it has the same properties as if you were to parse a string as an enum. Otherwise, if you know C++ it wouldn’t be too hard to write a function that could parse enums.

81894-capture.png

I know programmlanuages like java and so on, I know the basics of C++, but I can’t programm this in UE4

Have you at least tried to use Set Value as Enum?

I don’t use Blackboards or Behaivour Trees, or does this not matter?

Right - my bad. It may be that you could hack a parse if you had a blackboard component and used the function, but otherwise I don’t think it’s plausible to do in blueprints.

If you feel that this has answered your question, please mark the question as answered.Thanks! =)

Ok, do you have any idea, how to do this in C++ or do you know a good tutorial, which include things like these?

thanks. :slight_smile:

Do you have so good answers, on my other questions, which nobody answers?

This is how I did it, but it requires a new function for each enum.

This is my solution. It’s a bit clumsy, but it gets the job done, allowing you to reference thereafter and use Enum-based switches. I’m just going to change it around a bit to tell me if it can’t find one of the enum entries to match the name.

Bit late to the party, but this works for me.

1 Like