Unity Input System (ActionButton.cs <BUG>) - Integration Bug Help requested.

AF_Explorer

New member
I am running URP, and building for IOS. Unity New Input System is installed. Using RPG Schema.
New Input Package Integration from Opsive Installed. Here is the issue. On my mac I can click on the
Menu tabs which utilze this script on main menu and they will recognize the click. Once exported to IOS it
will not recognize a click on on these buttons. However other Action mapped controls work and other buttons like
the panel openers. The drag and drop user interface is working just fine on the inventory grid controls.
I think perhaps it could be this line?

using Opsive.UltimateInventorySystem.Input;

I am thinking all it needs is to be directed to use the new shared input.
What doesn't make sense to me is why it works on the mac but not on the iphone so maybe not.

Any help or suggestions as to how to get these buttons working would be amazing its totally blocking my game at the moment.
I am just a fair programmer but any work around even would be great.

Thanks!
 
Just to clarify your question. You do not detect any UI input on just the Main Menu tabs? All other UI buttons work?

The Main Menu tabs use the "ActionButton" component which is a custom Button I created inheriting the selectable component (The default Button component wouldn't let me do some of the more advanced navigation required by our UI).
I inherit the "IPointerClickHandler" and "ISubmitHandler" which to my knowledge should work on IOS devices (It works perfectly on Android devices, I just tested it).

The issue shouldn't have anything to do with using a custom input system since we are using the Unity UI Input system here.

My only guess is that you have a different resolution on your IOS device compared to your mac and that might squeeze things toghether and overlap an image on top of the buttons which blocks the UIRaycast.
Unfortunatly I do not have any IOS devices at disposition so I cannot test it for myself.

Just for good mesure try exporting the demo scene to IOS and check if the Main Menu tabs work there.

Also did it stop working after you made the switch to the new input system? Can you confirm that you are using the correct UI Event System?
If you missed it the documentation for the new input system integration is here: https://opsive.com/support/documentation/ultimate-character-controller/integrations/input-system/
And the UI input component I am talking about is this: https://docs.unity3d.com/Packages/com.unity.inputsystem@1.0/manual/UISupport.html
 
Last edited:
Hi Thanks for the response! I am currently struggling with this. So Yes, first I can confirm I am using the new input system and that event system component was upgraded to new input correctly. Also I watched the behavior on my Mac vs. IOS device. On the Mac I enabled the debug logs and can see the buttons highlight. They highlight on IOS too.. which is good. However on the press(screen tap) nothing.. I will check if an image overlaps(could be the case) and yes I have checked with the demo after converting it to new input and it happens in the demo also on IOS. I think it could be the cursor? Is there a simple way to enable the cursor?

Please note: the floating panels work perfectly as does the inventory Grid on IOS. The buttons on Gameplay screen respond to clicks. Its just the Main Menu Buttons.

Ill check resolution and overlap issues and get back. Thanks.
 
So I adjusted to iphone 11 pro max resolution just to check. It runs the same. I also was able to capture the following
from Xcode:

Pointer Click
Opsive.UltimateInventorySystem.UI.CompoundElements.ActionButton:OnPointerClick(PointerEventData)
UnityEngine.EventSystems.EventFunction`1:Invoke(T1, BaseEventData)
UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1)
UnityEngine.InputSystem.UI.InputSystemUIInputModule:processPointerButton(ButtonState&, PointerEventData)
UnityEngine.InputSystem.UI.InputSystemUIInputModule:processPointer(PointerModel&)
UnityEngine.InputSystem.UI.InputSystemUIInputModule:process()


I am getting this on clicks in Xcode so Its definitely registering a click.. but nothing happening.
 
I tested with the demo version in a clean project with the old input system and the menu buttons work correctly. However On IOS it is not rendering the characters or the camera is too far away or clipping. I didn't add any mobile controls I just wanted to test the click functionality. To me it looks like a problem with the button script not new input agree. If that screen was a floating panel like the inventory and equipment I bet it would be working. Mobile clicks are registering fine and working elsewhere its only that button control where it fails. Is it possible for me to just add the Save Functionality or basically everything on that display to a floating panel? And just nix those buttons? Or is there anything crucial I need out of those?
 
Screen Shot 2021-07-19 at 4.57.20 PM.png This will not pop on IOS, but also the actions do not execute even though I can see them hitting the invoke in the actionbutton.cs script. On my Mac it pops with no issue. This is worrying me as this is fundamental throughout your GUI code for implementing actions and custom actions like the one in your tutorial for the heal effect. I hope this helps because this seems like where it is breaking.
 
If the click is being processed then the buttons can't be the issue. The only thing I can think of is that the code that registers the listener to the click event failed to run.
Have you tried making a Development build. Are you getting any errors? I'm wondering if you have any AOT errors caused by attributes, If you do then you must use the Unit Options to create the attribute stub types.
Even one small error could prevent the UI from initializing and it would prevent all events listeners to register.

None of the UI is crucial for the functionality of the system. Some people create their own UI menus from scratch, some use just the InventoryGrid or custom ItemViewSlotContainers, most users use our Inventory UI without issues though.

I'd recommend you add some Debug logs in the Initialize function of the MainMenu script. That's where I listen to the click event with a lambda function. If the MainMenu script doesn't get initialized then that would explain the problem.

I hope that helps identify the issue
 
Hi. Thanks again for the reply! I will continue to investigate as I see value in your tool. I really want it to work on IOS!!!
I prefer not to re-write UI menus from scratch after a purchase this expensive honestly. Plus your code is pretty complex (and good don't get me wrong) I don't think you can say its IOS compatible with the new input system really. I think your input system package works perfectly however. You might want to add a disclaimer that action menus do not work with new input system or you have to re-write UI menus. Without doing so you will also not have access to the save functionality. Which I mean it can be done but I am trying to save time and this seems like something that could be fixed. I probably wouldn't have bought this if I had known. I hope that there is way you can reproduce it on an IOS device you guys must have one somewhere. I am not some apple fan boy btw. There is money to be made on IOS. I am happy to provide reproduction steps and more validation input. It should be tested on IOS. I have reproduced this on 2 devices now. I have tested on Iphone 11 and IPad Pro.
***It could be the case that the UI is not initializing and the event listeners are not registered. I think that may actually be it.***
I am at a loss as to how to fix this though. No ahead of time errors. Consider -->Here is the data from testing so far.

Game StateGame State
Demo WorkingFALSETRUE
Mac OSTRUETRUE
ActionButton.CS buttons working on IOS SystemsFALSETRUE
New Input SystemInstalledNot installed
Old Input SystemNot installedInstalled
Buttons other than ActionButton.cs Work?TRUETRUE
Opsive New Input Package installedInstalledNot Installed
Event System component updatedInstalledNot Updated
Player input component added to controllerInstalledNot added
Player Input Actions connect to Player input componentInstalledNot added
Player controller Works?TRUETRUE
 
Our UI system should work with the new input system and IOS, unfortunatly I don't have a way of testing this on IOS.
I will try to test it on Android with the new input system as soon as I have more time, there is no reason it should give different results.

You said you didn't have any "Ahead of Time" errors, but did you get any other errors either during build or when starting the game on IOS development build?

If you believe the problem is that the UI isn't being initialized, add a Debug.Log in the "DisplayPanelManager" Initialize function and in the "Main Menu" Initialize function. That should confirm whether or not the issue is from something that prevents initialization.

In the meantime I'll see if the problem is from the new input system. If it is, the issue may be from Unity and not our asset.
What Unity version and input system version are you using? Have you tested on an Unity LTS release?

Also are you using just the Ultiamte Inventory System, or are you using other Opsive/ Third party assets?
 
Hi again. Thanks again. I appreciate your help. I will do what you suggest and get back to you. My hunch is that it is not you guys. But the result of something else now. Mainly because the action buttons work with the old input system on IOS. Either way its super useful to know the solution for me and any other people that may run into this. I was thinking maybe it is my controller? but it is the same behavior with other controllers and the buttons and character movement work so probably not. Maybe something is left out of the player.inputactions on both that is needed for the it I was thinking but.. as you can see from the output its hitting those functions in ActionButton.cs so we know the clicks are being recieved. In order to test I reduced the inputs and I am only testing now using the following:

URP, Unity New Input System, Opsive UIS.
I will test with my own player controller and my own player.inputactions
and also the Character.inputactions supplied by Opsive custom package.
 
Its not Opsive Inventory system. So I tested a bunch and did some more new input system tutorials for good measure. I think it is broken for IOS. So I can get your actionbuttons working when I use the input debugger in unity and simulate touchscreen. Also I switched the event system behavior to all pointers as is. (I am not sure this is desirable) but it does work in simulation. I made a development build and the player controller works but not the touch on my iPhone 11. So i am blaming Unity for now. There may be some workaround. But now I am looking at using another input system. I know touch is working because i am doing a raycast and outputting the tag of the collider its hitting. I can see its values change as well in debug output. In simulation it deletes the object on touch. Build on iphone and nothing. I really want to like the new input system but hmm.. If anyone gets this working I'd love find the solution. For now I am moving on.
 
Top