Hey there! I’m currently making a click-to-move mechanic using the New Input System.I’m trying to avoid hard-coding the controls. Is it possible to get the Vector2 mouse pointer position ONLY when I click the left mouse button without having to call Mouse.current.position in my code?The ButtonControl returns a float. How do I make it return the Vector2 mouse position instead?
I don’t think it’s possible. The move and the click are considered two separate type of actions. Just like the left stick and the A button hit are two separate actions.
What you can do is to save the coordinates in onMove (moving action) and use it when the OnClickToMove comes.
This, by the way carries the possibility to remap these actions to leftstick + button or any other separate 2D + button setup. (Even like moving with WASD and clicking with Space or whatever)
Yeah, you’re right. I can create two separate actions, one for storing the mouse position and another for raising an event when the button is clicked.
But I was hoping for a solution where OnMove will work for all devices. Seems not possible at the moment, huh?
I edited the title to make things clear.