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"

removing widget not working

alt text

so im standing infront of a dilema. here´s the thing: i want to press esc to open the menu without the character moving in the background, then press esc again to close the widget.

i added the button, gave it a loop, A opens the wiget and the mouse, B closes the widget and the mouse (more or less) BUT the character was moving.

soo

i added "set input UI only" and the character stoped moving

but

now i can´t close the widget anymore. i tryed adding "set input game mode only" in case of B. but thats not working.

any suggestions?

Product Version: UE 4.19
Tags:
unbenannt4.png (387.0 kB)
more ▼

asked Jul 31 '18 at 02:31 PM in Using UE4

avatar image

Priogeth
18 2 9

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

1 answer: sort voted first

Do not use Flip and Input nodes for this as you're blocking the input this way.

Use Esc to open the menu normally but override OnKeyUp in the widget to restore the Input Mode Game Only:

alt text

Add the code to remove self from parent here - this will destroy the widget.

capture.png (146.5 kB)
more ▼

answered Jul 31 '18 at 02:44 PM

avatar image

Everynone
14.8k 77 25 62

avatar image Priogeth Jul 31 '18 at 03:37 PM

ok i dont´know were to add the code to remove self from parent there. im not using unreal engine very long.

this is were im currently at:

i made the esc key open the widget normaly and added your code into the widget blueprint alt text

now since the widget hasnt been destroyed it wont close, but the problem that the character is still moving remains again.

for those who dont know how to "override" in the widget blueprint here is a picture, since i had to look that up first: alt text

unbenannt5.png (428.9 kB)
avatar image Everynone Jul 31 '18 at 03:42 PM

ok i dont´know were to add the code to remove self from parent there.

Right after Set Input Mode Game Only.

avatar image Priogeth Jul 31 '18 at 04:03 PM

ok ive "set input mode to UI only" back into the level blueprint again and your suggestion is working. but. i have to click onto the widget befor it can disapear and my mouse is still visible. do you have a solution for this? im guessing this would be a more complext matter to solve at a later state.

Thank you for your support :)

avatar image Everynone Jul 31 '18 at 04:26 PM

Yes, when you Set Input Game UI Only, feed the Game Menu widget Return Value reference into In Widget To Focus:

alt text

You may also need to enable isFocusable flag inside of the Game Menu widget for this to work.


When it comes to mouse visibility, you can handle it via the controller - Get Player Controller -> Set Show Mouse Cursor.

Widgets, however, override this setting and force the cursor to appear by default. Each widget controls it separately, though - there is a small hidden tab in the Behaviour panel of each widget. This will allow you to individually control cursor behaviour over every single one of them:

alt text

Hope this makes sense.

untitled.png (132.0 kB)
untitled2.png (32.7 kB)
avatar image Priogeth Jul 31 '18 at 05:33 PM

found it. sadly this did not work. this is what happend: the menu was only visible when i held down the ECS button due to "isFocusable"

i still need to click on it in order to cancel it

and the mouse is still there when i set Curser behavior to True no matter if i use none or default.

the problem remains

Edit: wrong panel, but its not working in the right one too. Hint: the mouse is invisable untill i open the menu, duno if that helps

avatar image Priogeth Jul 31 '18 at 06:07 PM

oh this is my bad! i meant: my mouse is stil visible when i have closed the menu. sry for that!

avatar image Everynone Jul 31 '18 at 06:31 PM

You've marked it as resolved. Does it mean you got it to work the way you need it to?

I'm not sure what you expect from the mouse? You want it hidden in game and show in the menus, right?

avatar image Priogeth Jul 31 '18 at 06:39 PM

i marked my main question as solved "closing the widget" but your solution that solved my main problem, brought up some issues. i do not wish to see my mouse in the game. i only wish to see it in the menu. i used to have a solution for this. "flip flop". but that is now gone with your solution. i am creating a first person shooter. this should give more sense to the topic.

avatar image Everynone Jul 31 '18 at 06:56 PM

Makes sense.

In this case I would hide the mouse cursor in the controller. Leave the widgets cursor settings at their default values and then:

  • open the menu, show the cursor via player controller; maybe even position it in the centre of the widget for extra fanciness...

  • onKeyUp, do the stuff you're doing and just before removing the widget from the parent, get player controller and hide the cursor again

That should work like a charm. Good luck with the rest!

avatar image Priogeth Jul 31 '18 at 07:37 PM

this is my solution since the widget apparently has its own cursor. "Widgets have their own cursor control and you get to choose whether to show the cursor or not." alt text

alt text

its working now. thank you very much :)

unbenannt9.png (112.5 kB)
unbenannt8.png (103.2 kB)
(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