How to do a ground check?

So I tried making my own, but I don’t know the issue

using UnityEngine;

public class playerMovementVertical : MonoBehaviour {
    
    public GameObject check;
    [HideInInspector]public Rigidbody2D rb2d;
    public float jumpHeight = 7.5f;
    private bool canJump;
    [HideInInspector]public groundCheck script;

    private void Awake() {
        rb2d = check.GetComponent<Rigidbody2D>();
        script = check.GetComponent<groundCheck>();
    }
    private void Update() {
        if (Input.GetKeyDown(KeyCode.Space) && canJump && script.isGrounded) {
            rb2d.velocity = new Vector2(rb2d.velocity.x, jumpHeight);
        }
    }

    private void OnCollisionEnter2D(Collision2D colEnt) {
        if (colEnt.collider.tag != "Wall" || colEnt.collider.tag != "NoJump") {
            canJump = true;
        }
    }

    private void OnCollisionExit2D(Collision2D colExt) {
        canJump = false;
    }
}

using UnityEngine;

public class groundCheck : MonoBehaviour {
    public GameObject objFollow;
    public float yOffset; 
    public Rigidbody2D objRb;
    [HideInInspector]public bool isGrounded;

    private void Start() {
        objRb = objFollow.GetComponent<Rigidbody2D>();
    }

    private void Update() {
        transform.position = new Vector3(objFollow.transform.position.x, objFollow.transform.position.y + yOffset, objFollow.transform.position.z);
    }

    private void OnCollisionEnter2D(Collision2D col2d) {
        if (col2d.collider.name == objFollow.name) {
            Physics2D.IgnoreCollision(col2d.collider, col2d.collider);
        } else {
            isGrounded = true;
        }
    }

    private void OnCollisionExit2D(Collision2D col2d) {
        isGrounded = false;
    }
}

So I tried making it so the groundChecker ignores the player, that works fine, but I can’t jump at all.

Looks to me like the Physics2d.IgnoreCollision code is set to ignore all collisions. In the parenthesis you need to specify, separating with a comma, which two colliders are going to be ignoring collision. Instead I would word the if statement with a “doesn’t equal” the objFollow.name and get rid of the IgnoreCollision altogether.

I don’t work in 2D though, so I’m not sure exactly how much of what I said is the same, but I hope it helps.