Make player only jump when is on ground?

My player can still jump if he falls of platform. Thanks in advance :smiley:

There are other ways of doing this without collision checks or using string tag checks (Those tend to break when you refactor code later)

For example if the the only upward/downward movement is via jumping/falling then you could use something as simple as rigidbody velocity as shown here

Lets say hes not jumping hes just walking off an edge. If so IsOnGround is still true so he can still jump its an Easy fix add OnCollisionExit and in the code put isOnGrounded = false. That should fix it.
@felixholstlade

Ooooh ok, Maybe I’ll get this right - I’ve not tested this… Yo what the guy above said ;c

    private void OnCollisionEnter(Collision other)
    {
        if (other.collider.CompareTag("Ground"))
        {
            isOnGround = true;
        }
    }

Its just like what collision is that thing touching to change that mad value, Also It looks like your value is set to “isOnGround - false;” instead of isOnGround = false;" in the jump thing

Side note: Please use the Code Sample when you’re creating your question cause I’m lazy and I cant be bothered typing it down much easier to Copy and Paste :smiley: