If statement returning positive when not all conditions are met

after several hours of unity answers, changing the code and looking at the coding api i almost have my character movement script working properly. Now i have it so the character dashes the correct direction and after using several debug.log entrys ive found that somehow my dash() function is operating when the if statement perameters are not met, the main problem im experiencing is that as soon as i press space off the ground when holding a or d it executes dash even though isjumping shouldnt be true by then? i cant figure this out for the life of me please help

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class movement : MonoBehaviour
{

private bool isleft;
private bool isright;
void OnCollisionEnter2D(Collision2D coll)
{
    if (coll.gameObject.tag == "level")
    {
        isjumping = false;
        hasdashed = false;
        Debug.Log("all false");
    }
}

public float speed = 10f;
public float jumpspeed = 300f;
public void jump()
{
    rgb.AddForce(transform.up * jumpspeed);
    isjumping = true;
    Debug.Log("jumping");
}
void dashleft()
{
    rgb.AddForce(Vector3.left * dashspeed);
    Debug.Log("dashingleft");
    hasdashed = true;
}
void dashright()
{
    rgb.AddForce(Vector3.right * dashspeed);
    Debug.Log("dashingright");
    hasdashed = true;
}
private Rigidbody2D rgb;
private bool isjumping;
private bool hasdashed;
public float dashspeed = 90f;
// Use this for initialization
void Start()
{
    rgb = gameObject.GetComponent<Rigidbody2D>();
    isjumping = false;
    hasdashed = false;
}

// Update is called once per frame
void Update()
{
    if (Input.GetKey(KeyCode.A))
    {
        transform.position += Vector3.left * speed * Time.deltaTime;
        isright = false;
        isleft = true;
    }
    if (Input.GetKey(KeyCode.D))
    {
        transform.position += Vector3.right * speed * Time.deltaTime;
        isright = true;
        isleft = false;
    }
    if (Input.GetKeyUp(KeyCode.A))
    {
        isright = false;
        isleft = false;
    }
    if (Input.GetKeyUp(KeyCode.D))
    {
        isright = false;
        isleft = false;
    }

    if (Input.GetKeyDown(KeyCode.Space) && !isjumping && !hasdashed)
    {
        jump();
    }

    if (Input.GetKeyDown(KeyCode.Space) && hasdashed == false && isjumping == true  && isleft && !isright)
    {
        dashleft();
        hasdashed = true;
    }
    if (Input.GetKeyDown(KeyCode.Space) && hasdashed == false && isjumping == true && isright && !isleft)
    {
        dashright();
        hasdashed = true;
    }
    if (hasdashed ==  false) {
        Debug.Log("have not dashed");
    }
    if (isjumping == false) {
        Debug.Log("have not jumped");
    }
}

}

@kalsut1, from what I can tell, isjumping may never be reset to false (if there’s no matching collision),
so it may be sticking true.

That said, you should realize the logic is getting cluttered and difficult to understand. A lot seems to be redundant, so here’s a proposal for clearing it up. Note: I’m not testing this code, it just seems to be what I decipher when I read through your tests.

First, your code for A and D is ok. I see that you are sensing “repeat” of A or D being held, and clearing the bools when the key is released. One might argue about left and right bools (it has to be one or the other), but you do have a “neither” state, so you either need a tribool or use two bools like this.

That said, you don’t need to check space key down repeatedly. All of the code for the “space key” section seems to me only applicable when space key down is read.

 if ( Input.GetKeyDown( KeyCode.Space ) )
    {
      // first main test - if not jumping and not hasdahsed, jump
      if ( isjumping == false && hasdashed == false ) jump(); 

      // if jump() fired, it sets isjumping = true, or isjumping may have already been
      // true, so jump wouldn't have been called

      // if isjumping, then only if hasdashed is false we check for a dash 'command' via 
      // left or right

      if ( isjumping == true && hasdashed == false )
           {
            if ( isleft == true ) // note, if left is true, right CAN'T be
                 {
                  dashleft();
                  hasdashed = true;
                 }

            if ( isright == true ) // if right is true, left CAN'T be
                 {
                  dashright();
                  hasdashed = true;
                 }
           } // end of is jumping and not dashing

   }// end of "if keydown space"

Now the logic of the lower section (the space key) should be a little clearer. All if it is under an “if space key down”. If a jump should be called according to the two related bools, call it. That might change isjumping, and it is not clear by reading the code (mabye the bool should be set after jump is returned, like the dash clauses are).
Then, since it only makes sense to check for a dash if isjumping is true and hasdahsed is false, that wraps around the two tests for a left/right dash.

That said, check again for all situations where isjumping may never be reset to false (maybe hasdashed, too, for that matter).