SlothController.StartCooldownMoveRight C# (CSharp) Method

StartCooldownMoveRight() private method

Right Move Cooldown
private StartCooldownMoveRight ( ) : IEnumerator
return IEnumerator
    IEnumerator StartCooldownMoveRight() {
        int amtCollidingChecks = 5;
        _hasHitWallRight = false;
        _canMoveRight = false;

        //Check multiple time during animations if we're colliding with a wall 
        for(int i = 0; i < amtCollidingChecks; i++) {
            yield return new WaitForSeconds(MOVECOOLDOWN/ amtCollidingChecks);
            Collider[] hitWalls = Physics.OverlapSphere(rightHandCollider.transform.position, rightHandCollider.radius, wallLayerMask);
            if (hitWalls.Length > 0) OnCollisionRightHand();
        }
        
        _canMoveRight = true;
        _hasHitWallRight = false;
    }