Cant click buttons of widget by 'Set Input Mode Only'
hi everyone, I am doing a game which is similar with minesweeper. The pic below is my main game interface. The left part of the screen is game area and player can click each grid to uncover it. The right part is HUD part and in this area I set some buttons (110%, 150% etc) to gain more score. To switch the mouse cursor in the whole screen, I use 'Set Input Mode Game Only' and 'Set Input Mode UIOnly'. If the y-axis is less than a value, GameOnly. Otherwise UIOnly. The level BP is below. However, during the game, I can always click the grids in the left area but cant click buttons of widget(I can detect them when I cover them because I set different pics for buttons). If I remove the branch part here, I can click buttons if I click the widget part first when I enter the game. If not, I cant detect the widget. Can anyone help me solve the problem to make sure buttons work during the game?
asked Jul 24 '16 at 11:55 PM in Blueprint Scripting
had similar issues with the InputMode. The problem is that the input somehow gets messed up within the frame where you set the InputMode. And somehow the whole InputMode setup feels like it stacks the settings so you want to avoid calling it twice.
You have troubles because you set the InputMode every Tick. Here my sample how to avoid this:
Btw, you will need to check mouse position by viewport size to avoid position issues. Perhaps you need to count in Menu scaling as well. I just recommend you to check different viewport sizes to avoid surprises :)
And I wonder if you have any reason not to use "SetInputModeGameAndUI" which actually works pretty well? (at least with the TestButton in my ThirdPersonExampleMap)
hope that helps :) Marooney
answered Jul 25 '16 at 01:07 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here