I have a scene that has up to 6 user input fields. I want the next scene to be able to access these fields and randomly pick and display one. From the research I have gathered, it seems to me like I need a script that uses Don’tDestroyonLoad. After that, I’m totally lost. Any help would be much appreciated.
Hi @Gaege,
After that you can store the value of each input fields in the array of string.
Then use Random.Range(0,array.length) to get the random index and use that index to get the element from the array.
ex.
- Let’s take an array of string named inputValues
- Fill inputValues array with the value of each input fields
- Then get the random index value by using Random.Range() and use it as below.
inputValues[Random.Range(0,inputValues.Length)] gives you a random value.