Hi everyone. I was trying to make a menu (just learning about Blueprints), and got a problem with it.
Okay, 1st of all, there’s my BP:
Yeah, i know, that it’s maybe the easiest BP, that I could done, but i cannot understand, how to fix one bug.
So, the essence of the bug. When I click a Alt-button, menu appears, but when i’m trying to click any menu-button, my camera continues to move, and to click any button in Menu, i have to click RMB firstly… i want to remove that, to make that: Clicking Alt-button - camera and WASD-system (which is written in BP below) are locked - cursor is on the screen - i can press any menu-button.
I will be very grateful, who will help me and send him a gingerbread:)
This is how I would do it. Create a boolean that is set true or false when the widget is being created or destroyed. After creating and adding to viewport, you want to set the input mode game and ui. This should solve your RMB click in order to interact with the UI. Now we ignore look and move input so that we can’t move the camera or move the character with WASD. When destroying(hiding/removing) the widget, set the boolean false and enable move and look input. Set input mode game only so that you wont have to click back into the game to start controls. The problem we run into is that you can still click anything that isnt covered by the widget. There are a couple solutions but I think the boolean is the easiest.
Set a branch from you click input actions or events to only run if the menu is false(hidden/destroyed/etc.).