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?

the arrow with the item name is set in the blueprint


when the player looks at the object, it gets highlighted and then i set the widget to switch from nothing over the name to the interactions available

don’t mind naked mr clean over here

Let me get it straight.

You walk to the object and look at it, interactions available show. You press the LMB, dragging the mouse in needed direction, and when releasing interaction happens based on mouse direction movement.

Did I get it right?

exactly, sorry i’m bad at explaining things

but i dont want to show the mouse cursor

Ok, from the back of my head.

Don’t set input mode. Do it this way:
When you are pressing LMB set bool that will block camera and character movement, and instead will start setting variables to track mouse movement, for x axis and y axis. When releasing using these variables you can choose what to do. After that, set bool and variables back to 0.

i’ll try that when i’m done eating. any ideas on how i track the mouse x and y variables? i tried using a branch inside the input for the mouse x and y axis mapping but i cant say if it actually tracks it

1 Like

oh my god it works. i’ve been stuck on this for at least two months now. thank you, you’re my jesus

i did what u did and simply made a function to handle the interaction

the function:

the call is an event in the interactable blueprint that prints the location of the location of the mouse when releasing for debug

1 Like

wait, it only works when i go perfectly to the direction i need. is there a way to have an error margin? i tried a normalized to range node but it doesnt work


that fixed it

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.