x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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. alt text 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? alt text

Product Version: UE 4.9
Tags:
more ▼

asked Jul 24 '16 at 11:55 PM in Blueprint Scripting

avatar image

pcjjdy
27 8 15 21

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hi there,

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:

alt text

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)

alt text

hope that helps :) Marooney

switchinputmode.jpg (136.7 kB)
gameandui.jpg (46.2 kB)
more ▼

answered Jul 25 '16 at 01:07 AM

avatar image

Marooney
886 36 8 36

avatar image pcjjdy Jul 26 '16 at 03:44 AM

Hi, according to pic1, If I add doonce before InputMode Setting, The game can not run successfully. If I only add set InputModeGameAndUI after eventbeginplay, the right widget can not be detected after I click the game area. :(

avatar image Marooney Jul 26 '16 at 09:22 AM

Be sure i have tested this to figure out the solution for you :) So in the end it will work for you :)

So first things first: Do you get the PrintText messages when you move between Menu and Game? Or do you set the InputMode somewhere else before too? (Perhaps in another level before) Because this messed things up for me too in my projects.

avatar image Marooney Jul 26 '16 at 10:26 AM

Perhaps you want to create a new blank TestLevel and a simple widget with a button (PrintText on click) as i did, to recreate my sample on you side. So if it works you can then easily check for any difference in execution within your actual game for yourself :)

avatar image pcjjdy Jul 26 '16 at 11:48 AM

It does work! Thx :)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question