[Comment] Bug fix for double coroutine

After clicking “Fire 1” we can check if we have already had a coroutine running before.

if (Input.GetButtonDown("Fire1"))
{
      if (firingCoroutine != null) StopCoroutine(firingCoroutine);
      firingCoroutine = StartCoroutine(FireContinously());
}
1 Like

Privacy & Terms