Reset Jump Counter

publicclassHereWeGoMove : MonoBehaviour

{
privateRigidbody2Drb;
publicfloatjumpSpeed = 1200f;
publicboolgrounded = false;
publicTransformgroundCheck;
publicfloatgroundRadius = 0.2f;
publicLayerMaskwhatIsGround;
publicfloatmoveDirection;
publicfloatmaxSpeed = 0.25f;
publicboolfacingRight = true;
publicbooldoubleJump = false;
publicboolcanDoubleJump;
intcount = 2;

voidAwake()
{
groundCheck = GameObject.Find(“Cube”).transform;
}

voidStart ()
{
rb = GetComponent();
}

voidFixedUpdate ()
{

if(grounded)
doubleJump = false;

if(moveDirection < 0.0f)
{
rb.transform.Translate(newVector3(0, 0, -(moveDirection * maxSpeed)));
}
elseif(moveDirection > 0.0f)
{
rb.transform.Translate(newVector3(0, 0, moveDirection * maxSpeed));

}
//rb.velocity = newVector2(moveDirection * maxSpeed, rb.velocity.y);
grounded = Physics2D.OverlapCircle(groundCheck.position, groundRadius, whatIsGround);

if(count > 0)
{
if ((grounded || !doubleJump) && Input.GetButtonDown(“Jump”))
{

rb.AddForce(newVector2(0, jumpSpeed));
rb.gravityScale = 9.8f;

if(!doubleJump && !grounded)
doubleJump = true;

print ("count = " + count);
count --;

}

}

}

voidUpdate()
{
moveDirection = Input.GetAxis(“Horizontal”);

if(moveDirection > 0.0f && !facingRight)
{
Flip();
}

if(moveDirection < 0.0f && facingRight)
{
Flip();
}

}

voidFlip()
{
facingRight = !facingRight;
transform.Rotate(Vector3.up, 180.0f, Space.World);
}

}

You don’t appear to be resetting your count anywhere, you just reset the bool for double jump. Try changing Where you have if(grounded) to
if(grounded){
doubleJump =false;
count =2;
}

Hi Thx for responding. It works now. I had to make sure the player and the ground were on the same layer. So no change in the code just the inspector. Thx again.