How do i make my player jump properly

I am making a 2.5 game, and i want my character to jump. But when i jump, I dont know how to make it go back to the ground. Also, when i press play on Unity, it just instantly moves to the new position, with no animation.
Here is my code:

public float jump = 20f;
void Update () {
if (Input.GetKeyDown (KeyCode.Space)) {
transform.Translate (Vector3.up * jump * Time.deltaTime, Space.World);
}
}

Hey Daniel.

If you want to do physics, it’s good to use the built in Unity physics engine. Assuming that your model has a Rigidbody2D attached, you can use the following code:

public float jumpForce = 10f;
public Rigidbody2d rb2d;

void Start() {
    rb2d = this.getComponent<Rigidbody2d>();
}

void Update () {
    if (Input.GetKeyDown (KeyCode.Space)) {
        rb2d.AddForce(Vector2.up * jumpForce * Time.deltaTime)
    }
}