IEnumerator isn't working in my Coroutine

So I’m working on a 2d platformer where the player is a circle, and instead of adding a groundcheck I wanted to make it so that you can jump whenever, but with a cooldown. I added an IEnumerator for the Coroutine JumpReset, but it keeps giving me an error code saying that “The type or namespace name ‘IEnumerator’ could not be found” and I’m truly confused, as I was looking at a different script I had using the same IEnumerator format, one that did work, when I was scripting the code that gives me the error.
Here’s the script that won’t work:

using UnityEngine;

public class PlayerMovement : MonoBehaviour
{
    public float movementSpeed = 10f;
    private bool isJumping = false;
    private Rigidbody2D _rigidbody;

    private void Start()
    {
        _rigidbody = GetComponent<Rigidbody2D>();
    }

    private void Update()
    {
        var movement = Input.GetAxis("Horizontal");
        var dash = Input.GetAxis("Horizontal");

        _rigidbody.AddForce(new Vector2(movement, 0));

        if (Input.GetButtonDown("Fire3"))
        {
            if (isJumping == false)
            {
                StartCoroutine(JumpReset());
            }
        }
    }

    IEnumerator JumpReset()
    {
        isJumping = true;
        _rigidbody.AddForce(new Vector2(dash * 30, 12), ForceMode2D.Impulse);
        yield return new WaitForSeconds(0.5f);
        isJumping = false;
    }
}

Thanks for your time, and have a good day or night.

You need to add the System.Collections namespace at the top of your script, as that’s the namespace where IEnumerator comes from.

If you’re using Visual Studio or VSCode, click on your JumpReset method and a lightbulb icon should appear. Click on that icon and it will offer some quick-fix suggestions - one of them being to automatically add the namespace for you.

This quick-fix suggestions feature also applies to most other errors as well.

Thanks!

For the future, can you please post general scripting questions in the dedicated scripting forums.

Thanks.