Right click inv item

good day ppl ive beem struggling with something on editor, the green on click event only counts on left click, is there a way that i can make it to right click, like for example to use a potion or equip armor or weapon or use something on right click, can someone explain step by step plz im very noob in blueprint matter

Sounds like you’re clicking actual buttons - that’s not going to get you far. Right clicking on buttons can be hacked around but it’s not something that is supported.

Normally, you’d use a Border / Image for clicking:

331713-border.jpg


For something a tad more advanced (and highly recommended), you’d create a custom user widget that handles clicking. This way, if you ever want to update the way it looks or behaves, you only do it once rather than visit 20 widgets and fix up 100 buttons.

1 Like

im sorry but plz can u be more specific like im very dumb coz i really didnt understood, even with the pics :frowning:

so tecnacly i have 2 main widgets equipment ssystem and inventory and another widget for each inventory item and equipment item bouth of thous widgets are just button with text yes

i have many blueprints connected to thouse buttons like style and stuffs by removing button to use borders everything falls apart :frowning: ive been following the rpg tutorial from titanic games i gess it was a bad idea

Just to be clear, if you want something right-clickable in an interface, don’t use a button. Either use a border or an image and override onMouseDown, like in my picture.

And that’s precisely why I can’t recommend using native buttons for stuff like that. If you want to change the way they look / behave, you now must deal with styles and all kind of strange settings. Button are great if you want to Left Click->Beep->Do a Thing.

They can be useful, don’t get me wrong - they’re not flexible at all, though! They’re not great if you need something more, something non-standard. And the way buttons hungrily consume input and steal focus can be a blessing and a curse, both at the same time.


The method I suggested allows you for all kind of clicks, left, right, centre, scrolling, double, delayed, repeating, tunnelling (clicking behind otherwise visible interface), clicks with modifiers and many more interactions. It’s just more versatile.

For the most basic functionality, you’d wrap a border in a user widget, and then use those user widgets instead of native buttons.

If you must use a button, you can still wrap it in a user widget and then hack around it with precise clicks to intercept the clicks before they reach the button… it’s not worth it.


everything falls apart

Refactoring is normal. Hate to be that guy, but if that’s your first game ever, the chances of you completing it without rewriting the whole thing twice bit-by-bit are next to none.

But that’s OK. We live and we learn.

1 Like

well live and learn, time to spend a few hours delecting blueprints to rewhrite the button to be a border or image, from what i under stood as well border is even better than image, image also dont have many click options just 1 from what i saw so i gess ill try to do with the border, but can i use item on clicable border can i put an image behind or how would i ajust the widget with clicable border?

and gess its not all i have to delete

from what i under stood as well border
is even better than image, image also
dont have many click options just 1
from what i saw so i gess ill try to
do with the border

Perhaps I should have been clearer on this. It does not really matter if it’s border or image - it can be an overlay or canvas, or vertical box - we just need something Visible so the mouse can register a hit. It sure cannot be a button because they’re really good at 1 thing only.


The representation of your item will look something like this (but nicer, surely):

331794-item.jpg

The only Visible element here is the border at the top. But you will not be clicking the border per se (you can if you have special needs / mechanics), you’d be overriding behaviour for this entire widget.

The border serves only as something the mouse cursor can hit. This way you can also control what happens when the mouse enters / leaves this widget and many other things (as you can see the list of overrides is quite long!)

Overriding the border’s very own functionality (my original image) can be super useful if you have 5 borders in 1 widget and want every border to react differently to a click.

you ware clearer than cristal but im very noob in this matter, so you can kinda see me reading your messages like 100 times untill i get it

can you recoment me any youtube video that gives a nice tutorial on inventory with clicable borders? i saw a few but sorry to say and dont get me wrong your way of talking is confusing but the videos of tutorial that i saw untill now are even more, mainly coz im dumb, by following certain tutorials ive learned a lot in blender and unreal and ive made tons of progress, even climable walls and ik movment but certain thing omg they are killing me, and lately ive been burning weeds on the farm so i only have a few hours to work on takagas project, and when i come in on the end of day i badly have strenght to do something but i really wanna get the basics of the game done so after the hard part comes the fun ^^

Can’t recommend anything. UI is a vast topic. Not sure of how much help it is, but here’s an example of a clickable widget:

thank you so much you didnt had to make one for me XD that sure gives me a boost i made something like this b4 but was long ago and i dont remember ■■■■, i had to relearn what i had learn

im sorry for lack of experience but i would like to ask you something, notmaly by making for example and inventory widget, ppl make the inventory widget and then make another widget for the inventory slot, but can you make like a complete inventory in 1 widget only using the borders? without make the seperate widget for slot?

You can.

This is Eve Online, I don’t know how many items the player will put into their Cargo Hold (backback); they may have none but they may have 2 thousand items:

I would not make slots for these. Just add widgets to a grid.


I would definitely make slots for these, though:

331898-slots.jpg

I know how many elements there are going to be, I know their location, and the slots can be empty and still show. The slot will implement left & right click and behave differently when it has an item and when is does not have one.

Both the slot & the item can implement clicks separately.

  • if you right click in an empty slot, the slot can process it and decided what to do - open the inventory, for example
  • if you right click in a full slot, you’re actually clicking on an item in that slot and the item can bring up a context menu instead

That’s what the Handled / Unhandled replies do. They allow you to stop the input from reaching the layer underneath.

If I right click an item in a slot, I don’t want the slot to open the inventory, I want my context menu so I’ll pass Handled in the item’s onMouseDown. And the slot will never receive that click because the item Handled it.


Buttons can’t do any of that.

1,2,3.4, LMB, RMB, Q should be slots - what they display will change.


I wouldn’t bother with slots for the 6 small elements on the right - they’re always the same. And if you only want to left click them, I’d even risk using buttons here (still wrapped in a user widget because I may want to update them later).

But they can still be slots, it makes it easier if there’s more than 1 person working on the project. You prepare slots for the layout and a more artistic team member can drop a pretty widget there.

And if you decide to move that slot elsewhere, everything will still work.


Inventories are complex. I’ve made a few and it generally does not get easy.

my 1st inventory to open and close is
just a simple bluepring that brings
the widget to viewport, set control to
widget and show mouse cursor, and then
to close it its just the inverted
function very simple

Generally speaking, simplicity wins. But there are some behaviours that cannot be an on / off toggle.

  • you press ‘I’ in the player controller to open the inventory
  • set input mode to UI only so the player cannot move around
  • press ‘I’ in the player controller to close the inventory but…

…it no longer works; none of the keys work because we’re in the UI only mode. So now you must handle ‘I’ in the widget. Which is another brand new overridden function.