Can some help my why does this code not executing I get the 2 debug messages from the CallRollDice function but nothing from the RollDice function.
public void CallRollDice()
{
Debug.Log("clicked");
StartCoroutine("RollDice");
Debug.Log("ran");
}
private IEnumerable RollDice()
{
Debug.Log("called");
int randomInt1;
for (int i = 0; i < 10; i++)
{
randomInt1 = Random.Range(0, diceFaces.Length);
diceImage.sprite = diceFaces[randomInt1];
yield return new WaitForSeconds(0.05f);
}
}
When i researched the topic i found out that StartCoroutine function in some cases requires a function but in my case it is requires a string.
I am using unity version 2021.3.30f1 (lst)
StartCoroutine(RollDice())instead of going string/name based the compiler would tell you the issue right away ;)