Jump forward without moving?

Hi, this is my first post on UnityAnswers and I'm working on a first person racing game where you can only jump. Well that's the premise of it. I've got the basic move script but i can also use the CharacterMotor script if necessary.

My question is what would I add to the script to make the character jump in the air but also forward with space bar and no other buttons or outside forces?

Thanks in advance, Ex

The question is a contradiction. Jump forward without moving is like clapping hands without movement.

If you just want an up and down jump in place

just use:

   void Update()
        {
            CharacterController controller = GetComponent<CharacterController>();
    
    `if (controller.isGrounded)` 

 if (Input.GetButton("Jump"))
            
            moveDirection.y = jumpSpeed;
            }

otherwise it sounds to me like you are moving the world/area around and just having the vehicle hop in place.

If you have a race track and you already have the movements to "drive the vehicle all over the place, it would be much easier and less coding just to create a Player Camera and move it to the positioning view you want or use some sort of follow player function on the player cam (not the main cam).