How To Use Input Manager On Ios?

Hello,

I’ve been stuck for days on trying to get this to work. I have it working for when it is PC, but on Mobile it does not work.

My thought process is on PC pressing escape calls the input manager via the “Cancel” option. It works just fine. How would I make a button on the screen call that Cancel option when pressed via mobile?

    public void MenuButton()
    {
        if (CrossPlatformInputManager.GetButtonDown("Cancel"))
        {
            menu.SetActive(!menu.activeSelf);
        }
    }

You would put a Canvas in your scene, add a Button to it, and have that button’s OnClick event invoke some code that toggles the menu.

Go through the UI tutorials (see Learn at the top of this page) if this sounds unfamiliar.

1 Like