[C#] JUMP - What i must add to this code to jump? :>

Please about help :confused: Iโ€™m new in Unity and C## :confused:

Here my code:

using UnityEngine;
using System.Collections;

public class Player : MonoBehaviour {
public float moveSpeed;

// Use this for initialization
void Start () {
//Player spawn point
//This is where our player star when the game is played.
//player == game object. Game object == transform!
transform.position = new Vector3 (-5, -1, 0);
}
// Update is called once per frame
void Update () {
//Player to move left, righ
//player (gameobject) aka transform to move when i press the wsad
if(Input.GetKey(KeyCode.D))
{
transform.Translate(new Vector3(moveSpeed, 0, 0) * Time.deltaTime) ;
}
if(Input.GetKey(KeyCode.A))
{
transform.Translate(new Vector3(-moveSpeed, 0, 0) * Time.deltaTime) ;
}
}
}

Screen with player inspector panel

Screen with ground inspector panel

How about adding force to the rigid body? Iโ€™m defining the jumpForce as local, but this may be a global class variable. Placed within the code just for reference. Also the value may require to be tunned. Remove the is kinematic on your rigid body, otherwise you wonโ€™t be able to apply force to it.

 void Update () {
 //Player to move left, righ
 //player (gameobject) aka transform to move when i press the wsad
float playerJumpForce = 10.0f; //Define as global

 if(Input.GetKey(KeyCode.D))
 {
 transform.Translate(new Vector3(moveSpeed, 0, 0) * Time.deltaTime) ;
 }
 if(Input.GetKey(KeyCode.A))
 {
 transform.Translate(new Vector3(-moveSpeed, 0, 0) * Time.deltaTime) ;
 }
 if (Input.GetKey(KeyCode.Space))
{
  rigidbody.AddForce(Vector3.up * playerJumpForce);
}
 }
 }

Hope this helps