Input System UI Input Module - UI Button does not respond to click/hover

Hi,

I’m trying to get my button to respond to click/hover events with the new Input System. I have an empty object with a script containing a function which logs a message when called. This function is mapped to onClick() of a UI button.

My empty object also contains the Input System UI Input Module component, along with an Event System component which gets automatically added with it.

Images showing my setup are attached:

6110042--665228--upload_2020-7-20_22-39-22.png


Any help regarding this is very much appreciated.

Thanks!

2 Likes

I’m having the same problem. I’ve been searching for hours and trying all the usual interactable-UI debugging, but I’m starting to think it’s the New Input System that’s the problem. I have another separate project that uses the old input system and it’s working fine.

Did you come up with a fix for this?

1 Like

I haven’t found anything to solve this yet, so I have had to set this aside unfortunately.
I was hoping to get this noticed by @Rene-Damm for the proper solution.

2 Likes

Same. I was looking forward to using the new input system, but I’ve had to pivot to an alternative :confused:

1 Like

Sorry for the long delay. In general, any kind of “works with StandaloneInputModule but no longer works with InputSystemUIInputModule” is with almost 100% certainty a bug. Please file a ticket with the Unity bug reporter (“Help >> Report a Bug…” in the editor’s main menu) so we can have a look.

For debugging, first step I would recommend is popping open the input debugger (“Window >> Analyze >> Input Debugger”) and while in play mode and everything set up, checking if all the respective actions are enabled and bound to the right kind of things.

1 Like

If I’m correct I’m using the EventSystems, as long as you set it too the first control you want active it will work

EventSystem.current.SetSelectedGameObject(null);
EventSystem.current.SetSelectedGameObject(YourGameObject);

Also, note that for each button you will need to change the navigation up/right/down/left to the gameobject you want ti to go to.

May be it can help
UI doesn’t responds with Custom Input Assets

Just to help any more people who encounter this annoying issue.

Other than the general configurations of EventSystem and Canvas, there is another cause of the irresponsive UI buttons I figured out in my own programs and I think it may be the cause for most people.

The issue occurs when you add a camera by yourself (very common) without tagging it as MainCamera. If you have no clue of tagging it, then it is very likely to be your cause.

key point: The camera you use with standalone input module must be tagged as MainCamera. Otherwise it won’t recognise objects with no collider.