Hey guys :slight_smile:

well basically i made a script in java which shoots i am now making this in C# but i have run into a problem.

basically its the yield function in my java all i have to say is yield WaitForSeconds (etc)
but in C#

i put the following:

my variable which holds my time is called :

float ReloadTime = 2.2f

void Reload (){

               ReloadTimeYield ();
		
		
		
		if (Clips >0){
			
			
		  BulletsLeft = BulletsPerClip;	

}
}

IEnumerator ReloadTimeYield (){

  	yield return new WaitForSeconds (ReloadTime);
	
}

why is this not working ? if i shoot when the bullets run out the bullets reload to fast. I want my timer to take action so that if my bullets are 0 it will take 3 secs to reload

thank you very much in advance :slight_smile:

Problem Solved here is the correct answer if any one else wants to know how to call yields in C#

void Reload (){
	
    StartCoroutine(ReloadTimeYield ());
	
	
	
}

IEnumerator ReloadTimeYield (){
	PlayReloadAudio ();
  	yield return new WaitForSeconds (ReloadTime);
	
	if (Clips > 0){
		
		
	  BulletsLeft = BulletsPerClip;	
	
	}
}