Right-click on inventory makes the character move (topdown click-to-move project)

Hi all,

So i have my topdown project set up so I can click to move with both left-click and right-click. When I open my inventory, I can drag and drop items with left mouse button and my character won’t move (which is what I want). But when I interact with the inventory with Right-Mouse Button the character will move to the clicked location that’s in the world underneath the UI.

I could disable mouse events in the topdown controller entirely whenever the inventory panel is open, but that’s not what I want, because I want the character to move when I click in the viewport, even when the inventory is open. I just don’t want any interaction from my topdown controller when I’m right-clicking on the UI.

Any ideas how to go about this?

Thanks in advance!

I have a setup to prevent the third person character camera from moving when the user right clicks on a widget representing an inventory item.
It’s simply done by using a boolean check on the right mouse button event, which is reset on released but set whenever a widget is right clicked on.

Should they be able to move at all if the inventory is up? If so, add a bool and toggle that when they open and close the inventory. And when they click check if that bool is true for open inventory then if so don’t do movement. That’s my suggestion.