No overload for method `nombredeCorutina' takes `1' arguments

Hello! i know this is probably a stupid question but i need help because i don’t know what i’m doing wrong, and i need to fix this error. Here’s my code
public class enemyAttack : MonoBehaviour {

	public float time = 5f;
	private IEnumerator coroutine;	
	public Image image; 
	public float t = 5f;

	void Start () {
		coroutine = nombredeCorutina (time); 
		StartCoroutine (coroutine);
		image.gameObject.SetActive (false);
	}

	private IEnumerator nombredeCorutina (float t, Image im) {
					
		im.gameObject.SetActive (true);
			
		yield return new WaitForSeconds (t);  
			
		coroutine = nombredeCorutina (time);
		StartCoroutine (coroutine);
	}
}

Moved to the help room since it's a trivial logic error

1 Answer

1

Your IEnumerator expects a time, float t and a Image, Image im.

You are only passing the time on your call:

coroutine = nombredeCorutina (time);

you forgot to pass the image.