Unrealistic jump in C#

I’m using this code as gravitation (can’t change this):

Vector3 direction = dragTo.transform.position - transform.position; transform.position += direction * gravity * Time.deltaTime;

When I use:

transform.position += transform.up * speed * Time.deltaTime;

to jump my character does a very short and unrealistic jump. Can I do this in another way?

Not sure you using Rigidibody component for your character or not.

If you using it, you can use force to simulate more realistic jump

if(Input.GetKeyDown(KeyCode.Space))
            GetComponent<Rigidbody>().AddForce(Vector3.Up * Speed);

Scripting Reference: Rigidbody AddForce