Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

Question Using old input system (GetAxis) gamepad and keyboard to set mouse position

Discussion in 'Input System' started by Firlefanz73, Oct 16, 2023.

  1. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,316
    Hello,

    I am upgrading an old game to publish it on steam.

    It is using the old input system and I do not want to upgrade it to the new one because that would be much work. But can I use the old one still and also have features from the new one?

    I want to check two things (with the old version)
    - is the gamepad still connected if I use it (via GetAxis) - I can even see a warning if I disconnect it but do not know how to check that
    - how do I use the GetAxis like a mouse? With new input I would have Mouse.current.WarpCursorPosition, how do I do it without or can I use it somehow?

    I have set input system to "Both" in the build options but still cannot access "Mouse.current" (does not find "Mouse").

    Thanks a lot :) If I search I find the new input always....
     
    Last edited: Oct 16, 2023
  2. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,316
    I needed to import the new input system package after setting it to "both".
    Now it seems to work with Mouse.current.WarpCursorPosition, I am now trying to find a simple way to access buttons by "Fire1" or something similar....