Hello,
I wrote a bit of code that changes the sprite of a game object, but it freezes Unity, and I really don’t know why, can somebody help me, please?
IEnumerator Routine()
{
while (routineBool)
{
for (int i = 0; i > end; i++)
{
myself.GetComponent<SpriteRenderer>().sprite.Equals(animation[i]);
yield return new WaitForSeconds(0.4f);
}
}
myself.GetComponent<SpriteRenderer>().enabled.Equals(false);
}