how to make an object jump in unity code example
Example: how to make an object jump in unity
Rigidbody rb;
float force = 10f;
void Awake(){
rb = GetComponent();
}
void Update(){
if(Input.GetKeyDown(KeyCode.Space)) {
rb.AddForce(Vector3.up * force, ForceMode.Impulse);
}
}