Hello, I have created an in-game context menu activated by clicking and holding the right mouse button. The context menu disappears when RMB is released. The base of the context menu is from a video I watched on Youtube.
This project is based on the Top-Down example, so the primary gameplay input is the left mouse button (click on a spot to go there)
However, I am having some problems with input.
The Input Mode has to be set to “Game & UI” after the context menu widget is revealed (in the Widget BP event graph), in order to be able to hover and click the buttons of the widget.
However, if I do this, clicking on a button in the context menu widget also triggers the “Go here” LMB event in the player controller.
I’ve tried a bunch of things, like checking the status of RMB before going through with the LMB “go-here” event, switching the input mode at various points in the process, etc.
It seems like my main problem is how LMB is considered part of the Game input mode, when I need it to be both Game and UI, just at different times.
I should add, the requirement of hiding the menu when RMB is released added this complication.
The desired behavior is:
Right-click on an actor and keep RMB held down.
Context Menu comes up showing some options. With RMB held, one button can be clicked with LMB, which does something and closes the menu.
If RMB is released at any time the menu closes.
Is there some way to accomplish this?
Here’s an album showing the blueprints.