"KeyCode.Space" Not Working

As the title suggests, I am having an issue where the spacebar input specifically is not able to be detected. My code currently reads:

if (Input.GetKeyDown(KeyCode.Space))

After which I will print something to my console. When using KeyCode.Space, nothing is registering, but if I change it to say "KeyCode.A", I can press A instead, and everything registers just fine.

My project is basically brand new, and I have very few lines of code, none of which might interfer and cause issues with the input. I am not detecting any other keystrokes and the other parts of the script is made up of simple math operations and print statements.

Again, this issue is solely happening when trying to detect my spacebar; all other keys are working just fine.

Thanks in advance!

EDIT: After doing some more testing, it seems that while other keystrokes seem much more consistent, they do not work ong every run. Sometimes when I press play, the keystroke will work every single time and other times they will work none of the times. In other words, it is not that they are inconsistent within a “run”, but that they are either 100% working or 0% working, with no in-between.

I suggest using the new input system for better scaleablity.

Also that would fix this problem, unless you keyboard is broken obv.

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

public class TimeGame : MonoBehaviour
{

    float roundStartTime;
    int waitTime;

    // Start is called before the first frame update
    void Start()
    {
        print("Press the spacebar when you think the allotted time is up and see how you did!");
        SetNewRandomTime();
    }

    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Space))
        {
            float playerWaitTime = Time.time - roundStartTime;
            float timeDiff = Mathf.Abs(waitTime - playerWaitTime);

            print("You waited for " + playerWaitTime + " seconds. " + timeDiff + " seconds off!");
            SetNewRandomTime();
        }
    }

    void SetNewRandomTime()
    {
        waitTime = Random.Range(10, 21);
        roundStartTime = Time.time;
        print(waitTime + " seconds.");
    }
}