How to create a random outcome?
I am trying to create a system in Unreal Engine 4 where some things are provided randomly out of a large group of possibilities. For example, when the player presses a button to drink something I have variations of a drink sound that I want to play at random. I also have chests that I would like to have random loot in them. However, I can't seem to find a node that would allow me to do this. I had imagined something like a percentage of various outcomes that I could add on. Is there something like this in the blueprints? And if there isn't, is there a way I could do this? Any help would be appreciated!
asked Jun 24 '18 at 02:25 AM in Blueprint Scripting
Switch on int + random int in range to select a random event.
To decide what the probability of something happening is just take a random float and see if it's less than you your probability converted to a 0-1 value.(75% chance is 0.75)
Hope this helps. If not let me know.
answered Jun 24 '18 at 02:44 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here