Answer the question
In order to leave comments, you need to log in
How to get a random element of a list?
given a list
private List<string> Combinations = new List<string>();
Combinations.Add("111");
Combinations.Add("222");
Combinations.Add("333");
string Comb = Combinations[UnityEngine.Random.Range(0, Combinations.Length)];
'List' does not contain a definition for 'Length' and no accessible extension method 'Length' accepting a first argument of type 'List' could be found (are you missing a using directive or an assembly reference?)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question