Forum rules - please read before posting.

Input override does not work with Unity UI menu

Hi

I want to take control over mouse clicks on my inventory menu.
I've written the following code as a test:

private void Start()
    {
        KickStarter.playerInput.InputGetMouseButtonDownDelegate = MyGetMouseButtonDown;
    }

private bool MyGetMouseButtonDown(int btnPressed)
    {
        return false;
        //return Input.GetMouseButtonDown(0);
    }

This works fine with an source AC menu - no clicks are registered and nothing happens when clicking on a menu element.
But my menus are source Unity in Scene and when I shift to this the override has no effect - the inventory menu behaves as normally, registering left end right clicks.

Do input overrides only work with AC menus?

Comments

  • Yes - Unity UI input is set by the EventSystem and associated input module.

    AC has it's own such module that will be spawned automically, but you can override this by creating a new EventSystem prefab and assigning it at the top of the Menu Manager.

    If you use Unity's top toolbar to create a new UI -> Event System, you can modify the "Submit" input button to your own needs, make it a prefab, and then assign it in the Menu Manager.

  • Logic and simple.
    Great - it works for me now - thanks!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.