Need help with dashing code

I have followed this tutorial Unity Tutorial: Dashing like in Celeste & Hollow Knight - YouTube and it’s saying


Here’s my code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerMove : MonoBehaviour
{
private Rigidbody2D rb;
private BoxCollider2D bc;

private static bool isRunning;
private static bool isMoving;
private static bool isDashing;
private static bool isOnWall;
private static bool cooldown;
private static bool jumpCooldown;

private float time = 2;
private float dashingspeed = 14;
private Vector2 dashingDir;

// Start is called before the first frame update
private void Start()
{
    rb = GetComponent<Rigidbody2D>();
    bc = GetComponent<BoxCollider2D>();
    cooldown = false;
}

// Update is called once per frame
private void Update()
{
    
    float dirX = Input.GetAxisRaw("Horizontal");
    rb.velocity = new Vector2(dirX * 4f, rb.velocity.y);
    isMoving = true;
    
    float dirY = Input.GetAxisRaw("Vertical");
    

    if (Input.GetKey("left ctrl"))
    isRunning = true;
    else
    {
        isRunning = false;
    }

    if (Input.GetKeyDown("left shift"))
    isDashing = true;
    else
    {
        isDashing = false;
    }

    if (Input.GetButtonDown("Jump"))
    {
        rb.velocity = new Vector2(rb.velocity.x, 8f);
    }
    

   if (isRunning == true && isMoving == true)
    {
        rb.velocity = new Vector2(dirX * 6f, rb.velocity.y);
    }

    if (isDashing == true && cooldown == false)
    {
        cooldown = true;
        dashingDir = new Vector2(Input.GetAxisRaw("Horizontal"), Input.GetAxisRaw("Vertical"));
        isDashing = false;
        if (dashingDir == new Vector2(0,0))
        {
            dashingDir = new Vector2(transform.localScale.x, 0);
        }
        StartCoroutine(StopDashing());
    }
     

    if (isDashing == true)
    {
        rb.velocity = dashingDir.normalized * dashingspeed;
        return;
    }

    if (IsGrounded())
    {
        cooldown = false;
    }

    IEnumerator StopDashing();
    {
        yield return new WaitForSeconds(time);
        cooldown = false;
    }

} 

}

I found the errors and fixed the code, and I modified it to make it work better.

I cant send the code for some reason

I uploaded to google drive PlayerMove.cs - Google Drive

Also make a “Ground” layer and set all your ground colliders to that layer, and change the “groundIs” layerMask on the PlayerMove script to “Ground”.

And in your rigidbody settings, change the gravity to 5

It seems you have missed out some of the video,
I can see 2 errors:

  1. your IEnumerator StopDashing should not be inside Update it should be on its own.
  2. You havent made a bool IsGrounded() function yet so youre calling something that doesnt exist.