Using code for the FireContinuously bugfix at the end of the video

Instead of removing Mouse button 0 from being able to fire in the game, I tweaked the code to check for GetButtonDown OR GetMouseButtonDown (and the relevant UP options) to start and stop the FireContinuously Coroutine respectively.

    if (Input.GetButtonDown("Fire1") || Input.GetMouseButtonDown(0))
    {
        firingCoroutine = StartCoroutine(FireContinuously());
    }
    if (Input.GetButtonUp("Fire1") || Input.GetMouseButtonUp(0))
    {
        StopCoroutine(firingCoroutine);
    }

just thought I would share… :slight_smile:
Cheers,
Rob

Privacy & Terms