Search Unity

Question New Input System and Mouse Position

Discussion in 'Input System' started by scossgrove, Jan 4, 2024.

  1. scossgrove

    scossgrove

    Joined:
    Jan 6, 2016
    Posts:
    35
    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<Vector2>() 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?
     
  2. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    7,889
  3. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,463
    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.