Cant Move towards Right and Jump at same time?

Im new to unity and im trying to make a 2d game that requires my object to move towards the right and jump Unfortunately, im unable to make the object move and jump at the same time. Can someone help?
Heres the script im using. It appears to be that if the object is moving towards the right, the object is unable to jump. But if the object is able to jump, it is unable to move towards the right. Is my script over replacing the jump script?

Script #C

using UnityEngine;
using System.Collections;

public class Frog : MonoBehaviour
{

public Vector3 userDirection = Vector3.right;
float maxJumpHeight = 4.0f;
float groundHeight;
Vector3 groundPos;
float jumpSpeed = 15.0f;
float fallSpeed = 10.0f;
public bool inputJump = false;
public bool grounded = true;
public static int movespeed = 1;

void Start()
{
    
    groundPos = transform.position;
    groundHeight = transform.position.y;
    maxJumpHeight = transform.position.y + maxJumpHeight;
    
}

void Update()
{
    transform.Translate(userDirection * movespeed * Time.deltaTime);

    if (Input.GetKeyDown(KeyCode.Space)) Physics.Raycast(transform.position, -transform.up, 1);
    {
        if (grounded)
        {
            groundPos = transform.position;
            inputJump = true;
            StartCoroutine("Jump");
        }
    }
    if (transform.position == groundPos)
        grounded = true;
    else
        grounded = false;
}

IEnumerator Jump()
{
    while (true)
    {
        if (transform.position.y >= maxJumpHeight)
            inputJump = false;
        if (inputJump)
            transform.Translate(Vector3.up * jumpSpeed * Time.smoothDeltaTime);
        else if (!inputJump)
        {
            transform.position = Vector3.Lerp(transform.position, groundPos, fallSpeed * Time.smoothDeltaTime);
            if (transform.position == groundPos)
                StopAllCoroutines();
        }

        yield return new WaitForEndOfFrame();
    }
}

}

Does this even compile?

You have on line 25 a Physics.Raycast() just after the if statement doing nothing !
And I believe your doing it in a very complicated manner, try something more like that :
(I don’t garanty that it’s perfect, juste wroted it from scratch)

public class player_movement : MonoBehaviour
{
 private Vector3 movement;
 private float ground;
 private float speed = 15f;
 private float jump_power = 20f;
 public float gravity = 5f;

 void Start()
 {
   ground = transform.position.y;
 }

 void Update()
 {
  movement.x = speed; // moving to the right
  if (transform.position.y == ground)
      movement.y = (Input.GetButton("Jump") ? jump_power : 0f); // jump
  else
      movement.y -= gravity; // gravity
  transform.Translate(movement * Time.deltaTime); // applies movement
 }
}

EDIT : changed the jmping part, does the movement work?

Hmm, it still didnt make the object move nor jump