#are you messing with Time timeScale at
1 messages · Page 1 of 1 (latest)
my guess is you're destroying/disabling whatever calls StartCorotuine is coming from if its a separate object
wait
if the bullet sent the call if it get destroyed it stop the coroutine?
yea pretty sure
dayum then thats why xD
the bullet get destroyed when touching the ennemy
let me try
yea try without destroy
what you could do is put the StartCoroutine inside this same class you showed IEnumerator, but put inside a public void method , then call that method on Bullet collision instead of directly calling the Coroutine
public void get_celluled_pre(float damage_on_exploxion, float time)
{
StartCoroutine(get_celluled(damage_on_exploxion, time));
}
public IEnumerator get_celluled(float damage_on_exploxion,float time)
{
if (!immune_to_effects)
{
GameObject cell = Instantiate(Game_Manager.instance.cellule_on_enemy_go, my_sprite.transform);
print(time / 2);
yield return new WaitForSeconds(time/2);
print("dayum");
cell.GetComponent<SpriteRenderer>().sprite = Game_Manager.instance.cellule_on_enemy_2;
yield return new WaitForSeconds(time / 2);
cell.GetComponent<SpriteRenderer>().sprite = Game_Manager.instance.cellule_on_enemy_3;
yield return new WaitForSeconds(0.4f);
damaged(damage_on_exploxion);
Destroy(cell);
GameObject explo = Instantiate(Game_Manager.instance.cellule_exploxion, gameObject.transform.position, gameObject.transform.rotation);
Destroy(explo, 0.6f);
explo.GetComponent<SpriteRenderer>().color = new Color32(0, 255, 0, 255);
for (int i = 1; i < 7; i++)
{
Instantiate(player_shoot.instance.grenade_cellulaire_bullet, Random.insideUnitSphere * 2 + gameObject.transform.position, Quaternion.Euler(0,0, 360 / i));
}
}
yield return new WaitForSeconds(0.01f);
}
``` did this and it wors : O
thank u so much
nice!