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"

UMG "Inventory"


So I want to make slelectable inventory in middle of my screen in game. So it will look like that:

alt text

I just set up mouse position to middle of screen (it is not in middle :(). The blueprint looks like this

alt text

How can I set it up to be like the game pause and it will show mouse cursor where I will choose button e.g "HANDS" and it will hoover?

the character blueprint looks like that:

alt text

Product Version: UE 4.18
more ▼

asked Feb 09 '18 at 05:19 PM in Blueprint Scripting

avatar image

12 2 1 5

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

1 answer: sort voted first

Hi. You have to get a PlayerController object (from your pawn or from somewhere else) and use it's related nodes:

alt text

It will allow to adjust an input what you want. To allow only UI input you can use SetInputModeUIOnly. To return the game you have to use SetInputModeGameOnly. Also you have to set ShowMouseCursor property on controller to see a cursor. The best practice is to do all this things inside customized player controller and export only some functions from it to show\hide an inventory. Also you can handle input inside a controller - it allows to create a global functionality that doesn't depend on currently posessed pawn (if you don't switch characters it doesn't mater)

inputcc.png (64.2 kB)
more ▼

answered Feb 09 '18 at 05:46 PM

avatar image

1k 13 8 31

avatar image CR0G Feb 09 '18 at 06:09 PM

So I did in different way. Will show blueprint.

alt text

alt text

But now problem is with character rotation when I play game player just rotate with 90 degrese can't do 360 degrese. What is the problem ?

avatar image c4tnt Feb 09 '18 at 06:38 PM

Hmm... Sounds strange. Maybe your game lost capture and mouse is just blocked by the window edge? If it was you will still can turn around with keyboard arrows.

avatar image CR0G Feb 09 '18 at 06:46 PM

Nope, still same problem. I think there is some problem with mesh in character. Maybe this will help?

alt text

avatar image c4tnt Feb 09 '18 at 06:50 PM

You can change collision preset of your Hammer mesh to BlockNothing, maybe it will help if problem is with collision

avatar image CR0G Feb 09 '18 at 09:37 PM

There is nothing like BlockNothing, I just tried all of them and still is the same problem :(

avatar image CR0G Feb 09 '18 at 09:42 PM

I think if found problem. There is some problem with widget.. mean when I change visibility of hammer it working normal but is visible in game when Default button to open this widget in game is mouse right button so I have to press it once to choose something and duble to close so when I dubble click and widget is not visible I can only rotate with 90 degrese... What is the problem?

avatar image c4tnt Feb 10 '18 at 05:17 AM

It might be related to enabling mouse cursor - please try not to enable a cursor and check this bug again. If it will remain it would be better to use SetInputMode nodes instead.

avatar image CR0G Feb 10 '18 at 10:15 AM

But then how I will press the button if then I will want to mesh be visible?

avatar image CR0G Feb 10 '18 at 10:22 AM

Well I disable the mouse cursor and I press right botton to show widget so there I cant press button but when I duble click right mouse button it is come back normal and I can rotate around character. Is it the problem with engine or blueprint?

avatar image c4tnt Feb 10 '18 at 12:29 PM
avatar image CR0G Feb 10 '18 at 03:06 PM

I've just see that and I did that in functions. It is working. but when I press again right botton I can still see mouse but if I press left button the mouse is not visible and I can control player. This is blueprint:

alt text

alt text

avatar image c4tnt Feb 10 '18 at 03:25 PM

But there is no nodes I said about alt text alt text these nodes changes an input mode to allow you use GUI (UIOnly) and then to play a game (UIGameOnly)

rbn.png (59.4 kB)
brb.png (42.0 kB)
avatar image CR0G Feb 11 '18 at 05:11 PM

Ok, I did in different way. But thanks a lot of your time and help!

(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