[Comment] Possible solution for more than one button pressed

This is my Fire Method, let me know what you think.

private void Fire()
{
if (Input.GetButtonDown(“Fire1”))
{
if(RepeatFireCoroutine == null)
RepeatFireCoroutine = StartCoroutine(RepeatFire());
}

    if (Input.GetButtonUp("Fire1"))
    {
        if (RepeatFireCoroutine != null)
        {
            StopCoroutine(RepeatFireCoroutine);
            RepeatFireCoroutine = null;
        }
    }
}
1 Like

Privacy & Terms