lundi 18 janvier 2021

Unity random characters in string

How do I repeat generating a random char? I want to make a glitched text effect so I set:

textbox.text = st[Random.Range(0, st.Length)];

in my update method. I do however only get one character out of this line - how would I repeat this process in a string with the length of 5? What I am trying to achieve is to randomly generate 5 characters over and over again. There must be a better way than this:

randomChar + randomChar + randomChar + randomChar + randomChar

Thank you in advance!




Aucun commentaire:

Enregistrer un commentaire