How to do wallJump (Celeste-Movement Mix and Jam)

Hello, I need help. I have no idea how to fix this bug. The bug is every time I tried to do a wall jump it doesn’t let me do, but when I do wall jump while grabbing or the position I jumped is next to wall it works. This is the code * `
private Rigidbody2D rb;
public float speed = 10;
public float jumpForce;
public float slideSpeed;
public float wallJumpLerp = 10;
public float dashSpeed = 20;

private Collision col;

public bool canMove;
public bool wallGrab;
public bool wallJumped;
public bool wallSlided;
public bool isDashing;

public int side = 1;

// Start is called before the first frame update
void Start()
{
    rb = GetComponent<Rigidbody2D>();
    col = GetComponent<Collision>();
}

// Update is called once per frame
void Update()
{
    if (col.onGround)
    {
        wallJumped = false;
    }

    float x = Input.GetAxis("Horizontal");
    float y = Input.GetAxis("Vertical");
    Vector2 dir = new Vector2(x, y);

    Walk(dir);

    wallGrab = col.onWall && Input.GetKey(KeyCode.LeftShift);

    if(wallGrab) {
        rb.velocity = new Vector2(rb.velocity.x, y * speed);
    }

    if(col.onWall && !col.onGround) {
        if(x != 0 && !wallGrab) {
             wallSlide();
        }
       
    }

    if(Input.GetButtonDown("Jump"))  {

        if(col.onGround) 
        {
            Jump(Vector2.up, false);
        }
        if(col.onWall && !col.onGround) 
        {
            wallJump();
        }
    }
}

private void wallSlide() {
    rb.velocity = new Vector2(rb.velocity.x, -slideSpeed);
    
}

private void Walk(Vector2 dir) {
    if(!canMove) 
        return;
    if(wallGrab)
        return;

    if(!wallJumped) {
        rb.velocity = (new Vector2(dir.x * speed, rb.velocity.y));
    } else{
        rb.velocity = Vector2.Lerp(rb.velocity, (new Vector2(dir.x * speed, rb.velocity.y)), .5f * Time
        .deltaTime);
    }
}

private void Jump(Vector2 dir, bool wall) {
    rb.velocity = new Vector2(rb.velocity.x, 0);
    rb.velocity += dir * jumpForce;
}

private void wallJump() {

    StartCoroutine(DisableMovement(0));
    StartCoroutine(DisableMovement(.1f));
    
    Vector2 wallDir = col.onRightWall ? Vector2.left : Vector2.right;

    Jump((Vector2.up / 1.5f + wallDir / 1.5f), true);
    wallJumped = true;
}

IEnumerator DisableMovement(float time)
{
    canMove = false;
    yield return new WaitForSeconds(time);
    canMove = true;
}` 

I know this may be confusing but I need help. And anyone who wants to check the video here is the link : Recreating Celeste's Movement | Mix and Jam - YouTube

Hey you need to put your code in tags or something, can;t read it like this. But to answer your question I discovered a simple way how to making my current game. I just realized it might not work if you are using unity gravity, I set gravity in my project to 0 so that I could implement my own gravity, for more control. I use two collision boxes for my character one for my ‘body’ hit box, the other on the bottom just for detecting the ground. I have a grounded state on my characters and if they are not grounded then I apply gravity downwards, or any direction I want… So the ground hit box has OnTriggerEnter sets grounded to true, OnTriggerExit sets grounded to false. I have my walls tagged as ground aw well, but you can set it up other ways. so all you have to do to have wall climbing is make your ground box collider a little wider than then body collider. Then if you have body a little wider than the ground one your character won’t be able to wall climb. So you could control the wall jump ability with the width of the ground collider box. I hope that helps.