I can't do jump in my 2D game

Script is:
public class PlayerMovement : MonoBehaviour
{
public CharacterController2D controller;
float horizontalMove = 0f;
public float runSpeed = 40f;
public float jumpForce = 1000f;
public Rigidbody2D rb;
public Vector2 jumpHeight;
// Start is called before the first frame update
void Start()
{

}

// Update is called once per frame
void Update()
{
	horizontalMove = Input.GetAxisRaw("Horizontal") * runSpeed;
}

void FixedUpdate ()
{
	controller.Move(horizontalMove * Time.fixedDeltaTime, false, false);
	
	if(Input.GetKey(KeyCode.Space)) {
		rb.AddForce(jumpHeight, ForceMode2D.Impulse);
	}
}

}

It have a movement script, it working by CharacterController script, which I took from Internet. I don’t have problem with it. But jumping… I don’t have any errors, but when I pressing Space, my character is start flying.

P.S. English - not my native language, so sorry for mistakes in sentences.

That’s because your adding a jumpHeight force constantly even when character is in the air. Your character should instead jump only when it’s standing on the ground. If you google for ground check there’s plenty of tutorial how to achieve that.

You can look at this video explaining various solutions to this: 3 ways to do a Ground Check in Unity - YouTube