T
T
TooMajot2021-02-09 16:30:19
Unity
TooMajot, 2021-02-09 16:30:19

How to select random number from List(float) in Unity?

I just need a random number from the available ones:

private List<float> counts = new List<float> { -100, 0, 100 };

    private void Start()
    {
        float randomCount = //Random
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
freeExec, 2021-02-09
@TooMajot

UnityEngine.Random.Range(0, list.Count)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question