error CS0104: 'Random' is an ambiguous reference between 'UnityEngine.Random' and 'System.Random'

this is the part where i am getting error:

    IEnumerator RunSound()
    {
        if(isRunning == true && IsStepping == false)
        {
            IsStepping = true;
            StepNum = Random.range(1, 3);
            if(StepNum == 1)
            {
                footStep1.Play();
            }
            else 
            {
                footStep2.Play();
            }
        }
        yield return new WaitForSeconds(0.3f);
        IsStepping = false;
    }
}

When i run the code in unity i get error:
error CS0104: ‘Random’ is an ambiguous reference between ‘UnityEngine.Random’ and ‘System.Random’

There is a Random class contained in the System namespace as well as in the UnityEngine namespace.

Thus when you write

  StepNum = Random.range(1, 3);

The compiler does not know which class to pick.

you can work around this issue by specifying it:

 StepNum = UnityEngine.Random.range(1, 3);

or

 StepNum = System.Random.range(1, 3);

now i get new error:
error CS0117: ‘Random’ does not contain a definition for ‘range’