New Input System and Mouse Position

Hi,

Currently I have setup the new input system and assigned an action that passes the position of the mouse and I bind to this using the .performed event. This is working great and every time I move the mouse I get the event telling me the mouse has moved.

From this I use the pretty standard mechanism of using the camera to get he world position of the mouse.

However when I don’t move the mouse but the character is moved (normally be me handling other input system key events) I try reading the current mouse position using the ReadValue() and I am not getting the update mouse pointer but the last movement value.

Can anyone tell me how to get the mouse world position reflecting the alter movement?

Pointer.position gives you window space: Class Pointer | Input System | 1.7.0

Then you just need to convert it to world space: Unity - Scripting API: Camera.ScreenToWorldPoint

This is nothing to do with 2D features so this isn’t the correct forum.

Please look at the available forums before posting. I’ll move your thread to the Input System forum.

Thanks.