I have written a simple C# script for player jump(when i press the 'space' button a force is given to player). But it works like about 2 or 3 times for 10 attempts. What's wrong?
public float PlayerJump = 100f;
private void Update()
{
if (Input.GetKeyDown(KeyCode.Space))
{
rb.AddForce(0, PlayerJump * Time.deltaTime, 0);
}
}