How to get mouse position in Visual Scripting with the New Input System

Hey folks,
i was trying to get the current mouse position with the new Input System and Visual Scripting. Though i didn’t find any node for that purpose, only the three “On Input System Events”. Can someone point me in the right direction pls. ?

Thanks in advance.

Cheers,
Manu

1 Like

Same problem

If ound a solution. In the mapping switch the mouse binding from delta to Position. That worked for me, at least :slight_smile:

read above ^^

can you tell me the name of the function you have?
it is already position but in my case I need the mouse position when the left click is pressed

Hm, i have the same set-up, except i read the value all the time. Maybe it works for you, if you go to interactions and add “pressed”.

I tried and it doesn’t work, I don’t understand how a position could be pressed, and how the interaction could know if it is left or right click.
Can you show me how do you get the position in your case please? I don’t see how with both new input system and visual scripting

Sorry, been a bit busy. Here’s what i had (switched the system completely, didn’t fit my needs anymore).

Don’t know why my images always break… Did you convert the Input value from Screen Position to World Position ?

8280480--1085172--Screenshot 2022-07-15 072946.png

I seriously dislike the new input system for this reason

in the input window make a new action of pointer position and you have to add the input system library to your visualScripting in the project settings then once you have the input system library installed and regenerated go to your script and add a on inputSystemVector2 or something like that i forgot the exact name but you should be able to find it with that or just go with vector 2 and scroll a little then once you have the node in the dropdown pick the event that you had just made and the vector output is the position of your cursor or pointer i havent found the difference yet. And do remember that this position is relative to your screen so 0,0 is at the bottom left if you want to get the wold space postion then get a canvas to world space node put in your camera and the position of the cursor and you have the world space. good luck and i hope this helps