Button UI Not Working with The new Input system

Sorry if it’s a repost but since i can’t find if a tread show how to resolve that , i’m gonna Do one:

Since i’ve instal the new input system on my project, every button have stop working, so i’m pretty sure i’ve forget something important to do , and i’m kinda looking for it !
thanks

Okay I found what i was missing

Add:
InputSystemUIInputModule

UI support | Input System | 1.0.2

1 Like

guys u can use old and new input system just:go to performance>player>other setting and there is a setting wich u can choose both old and new setting

4 Likes

What exactly did you do? I’ve setup my game with the EventSystem set to the new “Input System UI Input Module.”

When the game plays starting at a main menu all buttons work just fine, but when I load a level that has a PlayerInput component in it, the UI buttons stop working in all of my menus.

Well, I found the culprit for me at least. After writing the above, I had noticed that the input action asset in my event system was the default asset, and the asset for my player input was not. And that got me thinking…

So, I set my event system to the same asset as my player input, and voila my buttons stopped working completely. Then, I went to look at the actions to see what was different and I noticed that I had setup my UI /Click action with a “Release Only” interaction in order to prevent getting the double performed event calls. So, I changed it to “Press Only” and now everything works just fine.

This has me suspect that even Unity thinks that this whole multiple firing of events thing is wrong and has implemented their UI stuff to only work the press part of the event only.

2 Likes

I tried several variations, in the end the only way I could make my canvas elements respond to input was to switch the Player settings for Active Input Handling from Input System to both. Then I deleted the Event System in the scene and re-added it, letting it default to the old input manager.

Curiously, the problem occurred ONLY in the editor. When I built the project using the new Input System only, the slider responded as expected.

FWIW, I’m running 2019.4.16 under Ubuntu.

We’ve had this too. Adding InputSystemUIInputModule didn’t work for us. I’ve no doubt we’re missing something that we don’t know about but it’s pretty dreadful that this system blocks fundamentals from working. I think we’re going to swap back to InControl.

1 Like

I’m having problems in conjunction with my XR rig. Menu and buttons works until I put on my Oculus headset and it goes out of standby, then buttons stop working. If I wait for the Oculus headset image to freeze again, they start working.

I am working on my first serious 2d afterwork unity project.
Was confronted with the issue that my UI Button was not clickable anymore after loading another scene, too.
Was first only using the new input system. Then did set the PLAYER to make use of both as described above. Was deleting the EventSystem and add it again. But it still was not working after loading my current problem scene from another scene.
Finally was the problem that “MyOnClick” public callback method was implemented in a “MySceneMainScript” which was just attached to an empty game object “MySceneMain”.
But “MySceneMain” was not only attaching this script. There were also two other scripts attached to it. One of them was including DontDestroyOnLoad(…). And that was my fault / the pitfall.
During executing the scene loaded from another scene, I did look into the inspector, clicked on the button, activated the DEBUG view of the properties and saw that the TARGET nested inside the ON CLICK node structure was empty, although it has been assigned before correctly.
Probably because the TARGET script was moved in the persistent DontDestroyOnLoad(…) at runtime in the inspector view, it was not reachable from the UI button anymore. The UI button and its parent CANVAS was of cause in the normal/NOT DoNotDestroyOnLoad section. This persistent script was already instantiated by the previous scene. And the current scene was not able to do so resulting with a destroy(gameObject) within the persistent script.
After removing that persistent script of my gameobject “MySceneMain” which was including the on click callback action it was fixed.
When I run the scene stand alone it work because the persistent script part could be instantiated correctly and would not destroy the current gameobject to keep only one persistent object of itseld at all. Because this it was working stand alone.
Did of cause then assign the persistent script to another empty gameobject independent from my UI reactions/callbacks to be able to run/test the scene standalone regardless of my solution workflow.

Just wanted to add to this thread in case it helps someone in the future, I had an issue where mouse pointer was not detected by UI at all, but ONLY in a build/build and run, in editor it worked.

I put the PlayerInput on a separate GameObject from the EventSystem and the rest, then set the binding of the mouse left and right click actions in the action map to interaction: press only. My thread is here for reference, with more details about my project setup. Hope this helps someone in the future.

Check if simulate touch input from mouse or pen option is off .
Under : Window - Analysis - Input Debugger - Option - simulate touch input from mouse or pen.

13 Likes

I’ll just chime in with my fix, just in case it’s the issue for others; my main menu screen was responding to input, but as soon as I clicked on my Options menu it would no longer respond. I just needed to select a button on the next menu (so for me it was Options Button, list of On Click events >> “Button” >> Select() ). Probably not the fix for most, but worth checking, I was chasing my tail for a while over that one.

Does anyone know how to solve this type of error?

Currently seem to be having an issue related where my slider is only changable with arrow keys, and clicking and dragging does nothing. Only happens on the scene where there is actually player input objects.

I had to put my player’s object in the menu scene, although this is not good at all. But now everything works fine, and I’ve been looking for a method similar to WithControlExcluding(samekeythatwaspressedBefore).

My fix was ridiculously simple, and I hope it is able to help someone else:
My controller and keyboard navigation inputs were working with selecting and pressing buttons, but my mouse wasn’t able to highlight or press them at all. In my input actions asset, under my “MenuNavigation” action map, the control I created for “Point” was storing the mouse delta in a vector 2 instead of the mouse position :sweat_smile: An easy to overlook semantic error, but it fixed my problem!

For me it was setting the Pointer Behavior to “All Pointer As Is”
Simple fix but works!

2 Likes

“All Pointer As Is” did the trick for me too, thank you. This all is very complex, I wonder if it could be simplified.

Had the same issue. Make sure that the input system package, does not have any devices inside… It worked for me after migrating from the Previous Input System

3 Likes

This was actually a feature that was previously working but seems to be broken in more recent releases of the InputSystem. My Onscreen buttons do not work at all, even in my older projects.

2 Likes