Why is my code not working?

private void OnCollisionStay(Collision collision) { if(Input.GetKeyDown(KeyCode.Space)) { Debug.Log("boing"); rb.AddForce(Vector3.up * 20); } }

I tested before and it is colliding, but when I press space nothing happens. Using C# and Unity.