How do I get the mouse input direction from the center of the screen to trigger an event from the released position of the mouse?

Hi,
I’m trying to make an interaction system where you press the left mouse bouton to start interacting with an object but an events only happens when you release it.

i want to get the mouse location from the center of the screen to trigger the contextual event BUT since I want to make a 4 way interaction wheel I need to get the value of the position and clamp it every 90 degrees so that the mouse can only go straight up, down, left or right.

The idea behind the interaction system is based on the one from life is strange. I have an interactable actor that displays a name within a certain range and when the actor gets highlighted, a ui shows up to display the possible actions.

214711-107985530

Can you show your code?

sure, for what part?

Click on object.

i only have a node that sets the mouse cursor to true right now, i deleted what i did an hour ago

working in blueprints

Player controller:
image
Object to click on:
image

this doesn’t do anything as I have the UI over the object follow my character’s camera.

i think that all i need is to get the position of the mouse clamped every 90 degrees according to the UI’s world position and location to fire off and event related to the last hovered component.

I’m struggling to make the mouse location to be the center of my ui when left clicking and i have no idea on how to implement the clamping(?) of the input

I’m guessing you are using widget. Are your input mode set to UI Only?

yes but once i release the mouse button it doesn’t go back to game mode only even though i set it to do that

Is that some Interaction mode switch?

the input mode when released doesnt work

I see, the problem is when you switch to UI Only you will loose Input Actions, they will get stuck.

the is interactable variable is set after the mesh gets highlighted and the ui changes to the interaction wheel, if it’s not set the it doesnt do anything to avoid glitches

yes, and that’s a problem

You need to set Game only from the widget.

i have multiple widgets that for the arrow direction of the interactable so i can’t focus on only one widget

i tried to set it on the event tick of one of my widgets for the arrow direction and now is shows the mouse cursor without me asking it to and it still gets stuck in ui mode

What is that mean?