Random Switch on enum
i want to include a random character. I have a enum for each parameter created , which is to be set for the character. But how can I generate a random parameter of a enum now?
asked Feb 24 '16 at 04:08 PM in Blueprint Scripting
Sentura is correct. To expand on that answer, take a look at this screenshot. You need to get a random int, convert that int to a byte (because enums are bytes in UE4), then convert that byte to the enum type you're using (firstnames, lastnames, genders etc), then set your variable.
answered Feb 25 '16 at 01:13 AM
Enums are just integers, so you can just use random int to get random enums. If you want less clutter, you can use the Select node and hook it up to an enumerator.
You can see the select node in action on this image: https://answers.unrealengine.com/storage/temp/46177-solus.png (the select node takes int, bool and enumerators as index values)
answered Feb 25 '16 at 12:59 AM
I have found a solution
but these appear very uncomfortable to me
is there a better one?
answered Feb 24 '16 at 04:25 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here