Hi. I have created two different widgets each only consisting of a button inside a canvas panel.
I have bound the OnClicked function for both buttons which results in a print string node being called.
There seems to be some problem with the input priority. Both widgets aren’t close to each other on the screen. I noticed that when I give a higher ZOrder value to the AddToViewport function for one of the widgets, the button stays active throughout the duration of the game but the other button becomes non-interactable. It is likewise if I do it the other way.
What can I do to make sure that both buttons remain interactable?
Ok, If that’s the case, something’s weird.
Is it necessary that you need to have two different widgets for each buttons? Why not put both buttons in the same widget?
I wasn’t sure about how to set visibility for each specific component in the widget so I didn’t try keeping both buttons in the same widget. What I usually do is, I create a class based on PlayerController and do the widget adding and visibility setting functionality in that.
I was able to reproduce the issue.
If the Visibility of the widget itself is set to “Visible” instead of “Non Hit-Testable (Self Only)” It’ll block the widget behind it. When both widgets were set to “Non Hit-Testable (Self Only)”, I was able to Interact with both.
Are you setting the visibility of the widgets anywhere?
Try setting the Visibility of the Widget Blueprints to “Non Hit-Testable (Self Only)” :
Select the widget itself :
Set Visibility to “Non Hit-Testable (Self Only)” :
Basically, I’m setting the visibility of these widgets to visible once they collide with a particular BP actor. So yes, there will be a time where both of these widgets will have a visible state