OnGUI() Inputs Not Getting Detected

Basically the title, I have tried multiple different input detections in OnGUI() such as getMouseButtonDown, getKey, and getButton but none are working.
Thanks <3


if (Input.GetKey(KeyCode.Space)) {
            Debug.Log("Click");
}

if (Input.GetMouseButtonDown(0)) {
            Debug.Log("Click");
}

Greetings, @FireFoundry01 I may have the wrong end of the stick but here goes…

OnGUI is used for Immediate Mode GUI, which is a special function GUI quite different from the Game Object based GUI (called UI System). If you are trying to create a typical game UI, don’t use OnGUI. Create GameObjects in the Hierarchy. Buttons and Sliders can be linked to public methods to execute function.

However, the examples you give would normally live in an Update loop. I can get them to run in OnGUI so there is no intrinsic problem and perhaps we need to understand what it is you’re trying to do and perhaps see a bit more code.