Ok, going to try to reach out on this issue one more time.

Still cannot figure out how to fix this. I want to create a simple double jump. I can get it to work partially, however the current issue is that if they player is on the ground, he can jump 2 times(As should) but if he is not on the ground, he can only jump once. So it is acting if 1 of the 2 availble jumps was already used. I have tried several different methods. But I am currently at this. The user has a groundCheck that can detect if the player is grounded. Here is the script.

using UnityEngine;
using System.Collections;

public class CharacterControl : MonoBehaviour {

    public float maxSpeed = 8f;
    bool facingRight = true;

    Animator anim;

    public bool doubleJump = false;
    public int jumpCount;
    public bool grounded = false;
    public Transform groundCheck;
    public float groundRadius = 0.2f;
    public LayerMask whatIsGround;

    public float jumpForce = 700f;
	
    //Apply Initial Settings.
	void Start () {
        anim = GetComponent<Animator>();
        jumpCount = 1;
	}
	
	void FixedUpdate () 
    {
        //Check for ground & update the animator.
        grounded = Physics2D.OverlapCircle(groundCheck.position, groundRadius, whatIsGround);
        anim.SetBool("Ground", grounded);
        anim.SetFloat("vSpeed", rigidbody2D.velocity.y);

        //To disable controls while jumping
        //if(!grounded) {return} 
        //that disables following code.

        //Allow user movement.
        float move = Input.GetAxis("Horizontal");
        anim.SetFloat("Speed", Mathf.Abs(move));
        rigidbody2D.velocity = new Vector2(move * maxSpeed, rigidbody2D.velocity.y);

        //Control the User 2D Rotation to Direction.
        if (move > 0 && !facingRight)
        {
            Flip();
        }
        else if (move < 0 && facingRight)
        {
            Flip();
        }

    }

    void Update()
    {
        bool jumpIsPressed = Input.GetKeyDown(KeyCode.Space);
        if (jumpIsPressed && grounded)
        {
            Jump();
            
        }else if(jumpCount <= 1 && jumpIsPressed)
        {
            Jump();
        }

        if (grounded)
        {
            jumpCount = 1;
        }
    }

    void Flip()
    {
        facingRight = !facingRight;
        Vector3 theScale = transform.localScale;
        theScale.x *= -1;
        transform.localScale = theScale;
    }
    void Jump()
    {
        anim.SetBool("Ground", false);
        rigidbody2D.AddForce(new Vector2(0, jumpForce));
        jumpCount++;
    }
}

Initialize jumpCount to 0 in the Start() function and re-initialize it to 0 on line 68 in the if (grounded) statement.

Your Jump() function needs an if statement around jumpCount++ like so:

void Jump()
    {
        anim.SetBool("Ground", false);
        rigidbody2D.AddForce(new Vector2(0, jumpForce));
        if(!grounded)
        {
            jumpCount++;
        }
    }

This is to make so it only increases the amount of times you’ve jumped when you’re in the air, previously jumping would always use up one of your two jumps even if you were on the ground when you jumped.

Let me step through the logic as written for you. Here is the ground jump logic.

  1. FixedUpdate runs. Grounded is set to true
  2. Update runs. Jump is called. JumpCount increases to 2. As the user is still grounded JumpCount is reset to 1
  3. FixedUpdate runs. User starts to move up. Grounded returns false.
  4. Update runs. Jump is called. JumpCount increases to 2.
  5. Update runs. User cannot call jump until it is reset by grounding.

Here is the air jump logic

  1. FixedUpdate runs. Grounded is set to false
  2. Update runs. Jump is called. JumpCount increases to 2.
  3. FixedUpdate runs. User starts to move up. Grounded returns false.
  4. Update runs. User cannot call jump until it is reset by grounding.

A far better way to code this would be to use a property to reset jumpcount every time the user becomes grounded. Pseudo code:

private bool _grounded;
public bool grounded {
    get {
        return _grounded;
    }
    set {
        _grounded = value;
        if(_grounded){
            jumpCount = 0;
        }
    }
}

The code above will work with your existing script. Place it instead of line 13. Also remove line 68.