Character can jump off walls (not intentional)

Recently i was able to fix my character from double jumping by using

void OnCollisionStay()
	{
		isGrounded = true;
	}
		
	void OnCollisionExit()
	{
		isGrounded = false;
	}

I’ve been using this for the physics of the ball

void FixedUpdate()
	{
		if (Input.GetKeyDown ("space") && isGrounded)
		{
			Vector3 jump = new Vector3 (0.0f, jumpheight, 0.0f);
			GetComponent<Rigidbody> ().AddForce (jump);
			isGrounded = false;
		}
		float moveHorizontal = Input.GetAxis ("Horizontal");
		float moveVertical = Input.GetAxis ("Vertical");

		Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
		rb.AddForce (movement * speed);
	}

And so far it has worked great except for the character can climb walls because all my walls count as OnCollisionStay or OnCollisionExit or at least that what it seems like to me.

GIF

I tried adding a tag to them by making it:

void OnCollisionStay(Collider other)
	{
		if (other.gameObject.CompareTag ("Ground"))
		{
			isGrounded = true;
		}
	}

But when I use that code for the script he doesn’t jump at all and the bool isGrounded is always set to false even though my ball is on the ground. I also made sure the ground he was on was tagged Ground so it shouldn’t be that.

Try giving each of the colliding objects a physics material. I had the same issue, and this worked for me.

I got an error when I used your code. So i turned to the documentation.

void OnCollisionStay(Collision other)
     {
         if (other.collider.gameObject.CompareTag ("Ground"))
         {
             isGrounded = true;
         }
     }

It’s working fine for me now.