Moving Left With Left Arrow Key Disabled When Holding Up Arrow and Down Arrow or Up Arrow and S Key

This is my code attached to a 2D cube. It moves left and right perfectly fine until I hit the up arrow and down arrow at the same time, or up arrow and S key at the same time. I don’t think it is an issue of my keyboard having limited input capabilities, if I hold any other 2 keys at once I can move left, and if I hold these keys down I can still move right. I don’t think it is reading the input for the left arrow key when this happens. Is this a keyboard glitch or is there something I’m missing? Any help would be appreciated, thanks.

void Update()
{

        if(Input.GetKey(KeyCode.LeftArrow))
            {
                transform.position += new Vector3(-1 * 7 * Time.deltaTime, 0);
            } else if(Input.GetKey(KeyCode.RightArrow))
            {
                transform.position += new Vector3(1 * 7 * Time.deltaTime, 0);
            }
    }

It’s because you used if else, study boolean logic. I’ll translate your code for you:

if player is pressing left arrow move character left, else if the player is not pressing left arrow and the player is pressing right arrow move the character right. The else statement can not be true unless the if statement it follows is false, if you want to be able to press both keys at once, just remove the else.