Trying to make a block jump and just go back down.

I am a beginner to unity and are using C#, and I’m trying to program a block to jump once and not linger in the air every time the jump key is pressed. Can someone give me some suggestions or tell me how to fix it?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Player : MonoBehaviour
{
    [SerializeField]
    private float _speed = 3.5f;

    [SerializeField]
    private float _jump = 5;

    [SerializeField]
    public GameObject _laserPrefab;




    // Start is called before the first frame update
    void Start()
    {
        transform.position = new Vector3(-10.92f, -0.44f, 0);

    }


    // Update is called once per frame
    void FixedUpdate()
    {
        float horizontalInput = Input.GetAxis("Horizontal");

        float jumpInput = Input.GetAxis("Jump");

        //Movement


        if (Input.GetKey(KeyCode.Space)) ;

        transform.Translate(Vector3.right * horizontalInput * _speed * Time.deltaTime);

        transform.Translate(Vector3.up * jumpInput * _jump * Time.deltaTime);

Are you just looking for a simple player controller?? There’s like ten billion of those out there. Here’s a hand FPS one:

I’m not doing an fps, I’m doing a 2d platformer.

I see you using FixedUpdate() but I don’t see any physics in there, no Rigidbody involved, so hence no gravity pulling you down.

Also, line 37 does nothing thanks to the semicolon at the end.

You might want to start with some 2D platformer tutorials… this stuff isn’t hard but I am certainly not retyping it all here.