error c# augment is out of range?

dos anybody know whats wrong here it keeps saying

ArgumentOutOfRangeException: Argument
is out of range. Parameter name: index
System.Collections.Generic.List`1[System.Int32].get_Item
(Int32 index) (at
/Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Collections.Generic/List.cs:633)
Car.GearSound () (at
Assets/Car.cs:368)

using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class Car : MonoBehaviour {

    public AudioClip collisionSound;   

   
    public WheelCollider flWheelCollider;
    public WheelCollider frWheelCollider;
    public WheelCollider rlWheelCollider;
    public WheelCollider rrWheelCollider;
    public float maxTorque = 150.0f;
    public float maxBrakeTorque = 500.0f;
    public float maxSteerAngle = 30.0f;
    public float maxSpeedSteerAngle = 10.0f;
    public float maxSpeed = 200.0f;
    public float maxBackwardSpeed = 40.0f;
    public float currentSpeed = 0.0f;
    private bool isBraking = false;
    
    public Transform flWheel;
    public Transform frWheel;
    public Transform rlWheel;
    public Transform rrWheel;
   
    
    public bool inverseWheelTurning = false;
    private int  wheelTurningParameter = 1;
   

    public List<int> gearSpeed;
    private int currentGear =0;
    
    public float FullBrakeTorque = 5000.00f;
    public AudioClip brakeSound ;
    public bool groundEffectsOn = true;

   
    public AudioClip motorSound;
    private AudioSource motorAudioSource;

   
   

    
    

    

    private WheelFrictionCurve frForwardFriction = new WheelFrictionCurve();
    private WheelFrictionCurve flForwardFriction = new WheelFrictionCurve();
    private WheelFrictionCurve rrForwardFriction = new WheelFrictionCurve();
    private WheelFrictionCurve rlForwardFriction = new WheelFrictionCurve();

    private WheelFrictionCurve frSidewaysFriction = new WheelFrictionCurve();
    private WheelFrictionCurve flSidewaysFriction = new WheelFrictionCurve();
    private WheelFrictionCurve rrSidewaysFriction = new WheelFrictionCurve();
    private WheelFrictionCurve rlSidewaysFriction = new WheelFrictionCurve();

    private float oldForwardFriction  =0.00f;
    private float oldSidewaysFriction  =0.00f;
    private float brakingForwardFriction  =0.03f;
    private float brakingSidewaysFriction =0.03f; 
    private float brakingSidewaysFrictionBackward = 0.01f;
    private float stopForwardFriction  =1;
    private float stopSidewaysFriction  =1;
    private AudioSource brakeAudioSource ;
    private bool isPlayingSound =false;



   
  

    public float centerOfMassY = 0;

   
    void Awake () {
  
	    if (inverseWheelTurning){
		    wheelTurningParameter = -1;
	    }
	    else{
		    wheelTurningParameter = 1;
	    }
        
        rigidbody.centerOfMass = new Vector3(0, centerOfMassY, 0);        
	    
	    oldForwardFriction = frWheelCollider.forwardFriction.stiffness;
	    oldSidewaysFriction = frWheelCollider.sidewaysFriction.stiffness;

	    InitSound();   	
	    
    }

    void Start (){
        

        frForwardFriction = frWheelCollider.forwardFriction;
        flForwardFriction = flWheelCollider.forwardFriction;
        rrForwardFriction = rrWheelCollider.forwardFriction;
        rlForwardFriction = rlWheelCollider.forwardFriction;

        frSidewaysFriction = frWheelCollider.sidewaysFriction;
        flSidewaysFriction = flWheelCollider.sidewaysFriction;
        rrSidewaysFriction = rrWheelCollider.sidewaysFriction;
        rlSidewaysFriction = rlWheelCollider.sidewaysFriction;
        
    }

    void InitSound(){
	    
	    brakeAudioSource = gameObject.AddComponent("AudioSource") as AudioSource;
	    brakeAudioSource.clip = brakeSound;
	    brakeAudioSource.loop = true;
	    brakeAudioSource.volume = 0.7f;
      
	    brakeAudioSource.playOnAwake = false;
        

      
        
	   
        motorAudioSource = gameObject.AddComponent("AudioSource") as AudioSource;
	    motorAudioSource.clip = motorSound;
	    motorAudioSource.loop = true;
	    motorAudioSource.volume = 0.5f;
	    motorAudioSource.playOnAwake = false;
	    motorAudioSource.pitch = 0.1f;
        
	    motorAudioSource.Play();

    
    }

    void FixedUpdate () {

	        currentSpeed = (Mathf.PI * 2 * flWheelCollider.radius) * flWheelCollider.rpm *60 /1000;
	        currentSpeed = Mathf.Round(currentSpeed);

	        if (((currentSpeed> 0) && (Input.GetAxis("Vertical") <0 )) || ((currentSpeed< 0) && (Input.GetAxis("Vertical") > 0 ))){
	  	        isBraking = true;
	        }
	        else {
		        isBraking = false;
        		
		        flWheelCollider.brakeTorque =0;
		        frWheelCollider.brakeTorque =0;     		
	        }
        	
	        if (isBraking ==false) {
		        if ((currentSpeed < maxSpeed) && (currentSpeed > (maxBackwardSpeed*-1))){
        			
			        flWheelCollider.motorTorque =  maxTorque * Input.GetAxis("Vertical");
			        frWheelCollider.motorTorque = maxTorque * Input.GetAxis("Vertical");        			
        			
		        }
		        else {
			        flWheelCollider.motorTorque =  0;
			        frWheelCollider.motorTorque =  0;
		        }
	        }
	        else {
		        flWheelCollider.brakeTorque = maxBrakeTorque;
		        frWheelCollider.brakeTorque = maxBrakeTorque;
		        flWheelCollider.motorTorque =  0;
		        frWheelCollider.motorTorque =  0;
	        }
        	
	        
	        float speedProcent = currentSpeed / maxSpeed;
            speedProcent = Mathf.Clamp(speedProcent, 0, 1);
	        float speedControlledMaxSteerAngle;
	        speedControlledMaxSteerAngle = maxSteerAngle -((maxSteerAngle-maxSpeedSteerAngle)*speedProcent);
	        flWheelCollider.steerAngle = speedControlledMaxSteerAngle  * Input.GetAxis("Horizontal");
	        frWheelCollider.steerAngle = speedControlledMaxSteerAngle  *  Input.GetAxis("Horizontal");

            FullBraking();
        	
	        SetCurrentGear();
	        GearSound();	
	
    }

    void FullBraking (){
	    if(Input.GetKey("space")){	
    	
		    rlWheelCollider.brakeTorque =FullBrakeTorque;
		    rrWheelCollider.brakeTorque =FullBrakeTorque;

		    if ((Mathf.Abs(rigidbody.velocity.z)>1) || (Mathf.Abs(rigidbody.velocity.x)>1)){
    			
                SetFriction(brakingForwardFriction, brakingSidewaysFriction,brakingSidewaysFrictionBackward);
			    SetBrakeEffects(true);	
		    }
		    else{
			    SetFriction(stopForwardFriction,stopSidewaysFriction);	
			    SetBrakeEffects(false);		
		    }
    		
	    }
	    else{		
		    rlWheelCollider.brakeTorque =0;
		    rrWheelCollider.brakeTorque =0;
		    SetFriction(oldForwardFriction,oldSidewaysFriction);	
		    SetBrakeEffects(false);		
	    }	
    }
    	
    void SetFriction(float MyForwardFriction , float MySidewaysFriction)
    {      

        frForwardFriction.stiffness = MyForwardFriction;
        frWheelCollider.forwardFriction = frForwardFriction;

        flForwardFriction.stiffness = MyForwardFriction;
        flWheelCollider.forwardFriction = flForwardFriction;

        rrForwardFriction.stiffness = MyForwardFriction;
        rrWheelCollider.forwardFriction = rrForwardFriction;

        rlForwardFriction.stiffness = MyForwardFriction;
        rlWheelCollider.forwardFriction = rlForwardFriction;

        frSidewaysFriction.stiffness = MySidewaysFriction;
        frWheelCollider.sidewaysFriction = frSidewaysFriction;

        flSidewaysFriction.stiffness = MySidewaysFriction;
        flWheelCollider.sidewaysFriction = flSidewaysFriction;

        rrSidewaysFriction.stiffness = MySidewaysFriction;
        rrWheelCollider.sidewaysFriction = rrSidewaysFriction;

        rlSidewaysFriction.stiffness = MySidewaysFriction;
        rlWheelCollider.sidewaysFriction = rlSidewaysFriction;
    		
    }

    void SetFriction(float MyForwardFriction , float MySidewaysFriction ,float MySidewaysFrictionBackward)
    {
       
        frForwardFriction.stiffness = MyForwardFriction;
        frWheelCollider.forwardFriction = frForwardFriction;

        flForwardFriction.stiffness = MyForwardFriction;
        flWheelCollider.forwardFriction = flForwardFriction;

        rrForwardFriction.stiffness = MyForwardFriction;
        rrWheelCollider.forwardFriction = rrForwardFriction;

        rlForwardFriction.stiffness = MyForwardFriction;
        rlWheelCollider.forwardFriction = rlForwardFriction;

        frSidewaysFriction.stiffness = MySidewaysFriction;
        frWheelCollider.sidewaysFriction = frSidewaysFriction;

        flSidewaysFriction.stiffness = MySidewaysFriction;
        flWheelCollider.sidewaysFriction = flSidewaysFriction;

        rrSidewaysFriction.stiffness = MySidewaysFrictionBackward;
        rrWheelCollider.sidewaysFriction = rrSidewaysFriction;

        rlSidewaysFriction.stiffness = MySidewaysFrictionBackward;
        rlWheelCollider.sidewaysFriction = rlSidewaysFriction;
    		
    }

    void SetBrakeEffects(bool PlayEffects){

	    bool isGrounding = false;
	    
	  
	    if(PlayEffects == true){
		    WheelHit hit;
    		
		    if (rlWheelCollider.GetGroundHit(out hit))
            {
			 
			    
			    isGrounding = true;
			   
    			
			    
		    }
		    else{
			    	
			   
			    		
		    }
    				
		    if (rrWheelCollider.GetGroundHit(out hit)){
			   
			    
			    isGrounding = true;
			    
		    }
		    else{
			    		
			  
			    		
		    }
    				
		    if((isPlayingSound==false)&&(isGrounding == true)){
			    isPlayingSound = true;
			    brakeAudioSource.Play();					
		    }
		    if(isGrounding == false){
			    isPlayingSound = false;
			    brakeAudioSource.Stop();					
		    }
    		
	    }
	    else{
		    isPlayingSound = false;
		    brakeAudioSource.Stop();

		 	
		    
	    }
    	
    }
  
    void Update () {

	    RotateWheels();
	    SteelWheels();
	    
    	
    }

    void RotateWheels()
    {
	    flWheel.Rotate(flWheelCollider.rpm / 60 * 360 * Time.deltaTime * wheelTurningParameter ,0,0);	
	    frWheel.Rotate(frWheelCollider.rpm / 60 * 360 * Time.deltaTime * wheelTurningParameter,0,0);	
	    rlWheel.Rotate(rlWheelCollider.rpm / 60 * 360 * Time.deltaTime * wheelTurningParameter,0,0);	
	    rrWheel.Rotate(rrWheelCollider.rpm / 60 * 360 * Time.deltaTime * wheelTurningParameter,0,0);	
    }

    void SteelWheels() 
    {
        flWheel.localEulerAngles = new Vector3(flWheel.localEulerAngles.x, flWheelCollider.steerAngle - flWheel.localEulerAngles.z, flWheel.localEulerAngles.z);
        frWheel.localEulerAngles = new Vector3(frWheel.localEulerAngles.x, frWheelCollider.steerAngle - frWheel.localEulerAngles.z, frWheel.localEulerAngles.z);
    }

    void SetCurrentGear()
    {
        int gearNumber;

        gearNumber = gearSpeed.Count;
    	
	    for (var i=0; i< gearNumber;i++){
		    if(gearSpeed*>currentSpeed){*
  •  	    currentGear = i;*
    
  •  	    break;*
    
  •      }*
    
  •  }*
    

}

void GearSound(){

  •  float tempMinSpeed = 0.00f;*
    
  •  float tempMaxSpeed = 0.00f;*
    
  •  float currentPitch  = 0.00f;*
    
  •  switch (currentGear) {*
    
  •      case 0:*
    
  •  	    tempMinSpeed =0.00f;*
    
  •  	    tempMaxSpeed = gearSpeed[currentGear];*
    
  •  	    break;*
    
  •      default:*
    
  •  	    tempMinSpeed = gearSpeed[currentGear -1];*
    
  •  	    tempMaxSpeed = gearSpeed[currentGear];*
    

break;

  •  }*
    
  •  currentPitch =(float)(((Mathf.Abs(currentSpeed) - tempMinSpeed)/(tempMaxSpeed-tempMinSpeed)) + 0.8);*
    

if (currentPitch > 2) {
currentPitch = 2;
}

  •  motorAudioSource.pitch = currentPitch;*
    

}

}

switch (currentGear) {
case 0:
tempMinSpeed =0.00f;
tempMaxSpeed = gearSpeed[currentGear]; // < – Line 368
break;

  default:
    tempMinSpeed = gearSpeed[currentGear -1];
    tempMaxSpeed = gearSpeed[currentGear];
    break;
}

If you look at you code on line 368 you are accessing the zeroth item in the gearSpeed List.

The error you are seeing would be expected if this list empty. Does it have any contents?

you haven’t initialized gearSpeed[] anywhere!