Smooth double jump Unity 2D platformer
<p>I'm trying to make a smooth double jump mechanic for Unity 2D, platformer game but right now the second jump is bigger if you jump right after the initial jump and I want to have it the other way around the double jump should throw you higher if you press it later like in most 2D platformer games this is my code</p>

<pre><code>       private void Update()
       {
            grounded = Physics2D.OverlapArea(transform.position, GroundedEnd.position, 1 &lt;&lt; LayerMask.NameToLayer("Ground"));
            if (grounded || !doubleJumpUsed)
            {
                playerRigidBody.AddForce(new Vector2(0, JumpPower));
            }
            if (!grounded &amp;&amp; !doubleJumpUsed)
            {
                doubleJumpUsed = true;
            }
            UpdateJumpingAnimator();
        }

        private void UpdateJumpingAnimator()
        {
           if (grounded)
           {
               doubleJumpUsed = false;
           }
        }
</code></pre>