Character Keeps goin up when jumping

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Jump : MonoBehaviour
{
    private Rigidbody playerRb;
    public float jumpForce;
    public float gravityModifier;
    public bool isOnGround = true;

    void Start()
    {
        playerRb = GetComponent<Rigidbody>();
        Physics.gravity *= gravityModifier;
    }

    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Space) && isOnGround)
        {
            playerRb.AddForce(Vector3.up * jumpForce, ForceMode.Impulse);
            isOnGround = false;
        }
    }

    private void OnCollisionEnter(Collision collision)
    {
        isOnGround = true;
    }
}

Hi and welcome,

Could you please edit your code to use Code tags. It would be much easier for us all here to check your code.

You can do it with that button next to text “Code:” in the forum editor. Or manually add the tags.

Your code looks somewhat OK to my eye. I tried it with different values (see below) and it worked just fine.

Try setting defaults for the values, too:

private Rigidbody playerRb;
public float jumpForce = 5;
public float gravityModifier = 1;
public bool isOnGround = true;

When you have found good defaults, write them down like that. Next time you add your component, those will be the preset values.

Also, make sure that you have RigidBody and Collider in the objects you want to interact with Physics.
Set the static objects like ground to be Kinematic, as you don’t want them to move.

Still does the same thing and when i add a collider my Character Movement stops working

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ThirdPersonCharacterControl : MonoBehaviour
{
    public float Speed;

    void Update ()
    {
        PlayerMovement();
    }

    void PlayerMovement()
    {
        float hor = Input.GetAxis("Horizontal");
        float ver = Input.GetAxis("Vertical");
        Vector3 playerMovement = new Vector3(hor, 0f, ver) * Speed * Time.deltaTime;
        transform.Translate(playerMovement, Space.Self);
    }
}

Your code worked just fine and I got a cube to jump, like I said. You are probably doing something else wrong in your scene that made it fail.