void Update() { if (Input.GetKeyDown(KeyCode.Space)) { // Spacebar was pressed } if (Input.GetMouseButtonDown(0)) { // Left mouse was pressed } }