"proper" Way To Uset Input.getaxis() In Update As An "onbuttondown" Event.

I want this code to run only once every time I press a button, but when I have the code inside Update it gets called several times, which makes sense. I can think of several ugly ways around this, but is there some intended way to deal with this scenario?

private void Update()
    {
            if (Input.GetAxisRaw("Pause") == 1)
            {
                if (GameManager.instance.mainState == GameManager.MainState.PLAY)
                    ShowPauseMenu(true);
                else if (GameManager.instance.mainState == GameManager.MainState.PAUSE)
                    HidePauseMenu();
            }
    }

I don’t think you want your Pause button as an axis. Use GetButtonDown instead:

It’ll only be true for the very first frame that Pause is pressed.

Okay, Ill try that! thanks!