Gravity trouble: Falling slow, jumping fast

I’m a noob so go easy on me.

I’m trying to make a simple jump function. Unfortunately, I go up very quickly and come down very slowly. Code is this:

void FixedUpdate()
{
    float moveHorizontal = Input.GetAxis("Horizontal");
    float moveVertical = Input.GetAxis("Vertical");
    Vector3 movement = new Vector3(moveHorizontal, 0.0F, moveVertical);

//Note I'm not adding anything to the y vector here ^

 rb.velocity = movement * speed;

    if (Input.GetKey("space") && detectGround())
    {
        rb.AddForce(0.0F, 1000, 0.0F);

//It seems like I'm adding way too much force on y vector, but even with that much I barely leave the ground. I need, like, 10,000 to get a good high jump.

    }
}

bool detectGround()
{
    Vector3 down = transform.TransformDirection(Vector3.down);
    return Physics.Raycast(transform.position, down, .51F);
}

I’m aware that I might run into weird gravity problems if I’m using odd scales, but I’m dealing with a 1x1x1 sphere in this case. Drag is also not the problem (and if it was, why do I go up so fast?). I’ve also tried adding some weight to my gravity by changing my y vector. That makes me fall faster but doesn’t help the jump any.

Interestingly, I don’t seem to have this problem if I use rb.AddForce(movementspeed) instead of rb.velocity = movementspeed. Then, however, I don’t get the tight control that I want for my X axis and Z axis. (I accelerate too slowly, never hit a peak speed, and have trouble stopping).

How do I fix this?

The problem should be here

Vector3 movement = new Vector3(moveHorizontal, 0.0F, moveVertical);
rb.velocity = movement * speed;

Adding a force to a rigidbody changes its velocity but that velocity only applies for 1 FixedUpdate because you specifically set the velocity.y component to 0 every FixedUpdate. Adding a huge force works because that causes velocity to change a lot so your character ends up high in the air in one FixedUpdate before you override the velocity again.

The solution is not to change the velocity.y.

Vector3 movement = new Vector3(moveHorizontal, 0.0F, moveVertical)  * speed;
movement.y = rb.velocity.y;
rb.velocity = movement;

what if I am not using velocity but AddForce instead ?