Hello, i would like to know how to make it so that, even in you hold down the space/ up key for any amount of time, the jump is always the same height, because at the moment if i were to hold down the space/up key for say 5 seconds, the object would never fall, and my game depends on the object jumping and falling the same height on every jump. Thanks
My Jump Code:
using UnityEngine;
using System.Collections;
public class Jumping : MonoBehaviour {
// Player Jump
public int jumpHeight;
// Update is called once per frame
void Update () {
// Left Control
if (Input.GetKey("up")){
rigidbody.AddForce(new Vector3(0, jumpHeight,0), ForceMode.Force);
}
}
}