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);
}
}