public class NameOfScriptFile : MonoBehaviour {
public int jumpHeight= 800;
private bool isFalling = false;
void Update () {
if (Input.GetKeyDown(KeyCode.W) && isFalling == false)
{
rigidbody.velocity.y = new Vector3(rigidbody.velocity.x, jumpHeight, rigidbody.velocity.z);
}
isFalling = true;
}
void OnCollisionStay(Collision other)
{
isFalling = false;
}
}
NameOfScriptFile should be the name of your script file and also the name of your class
Note: Kindly take a note that UA is not here to convert your scripts for you. It is severely frowned upon and against the guidelines of asking questions. Helping you out since it’s your first time. It will be better for you if you learn to do it yourself.