Search Unity

Upgrade Script / Reference Table ?

Discussion in 'Input System' started by AppBite, Jun 29, 2020.

  1. AppBite

    AppBite

    Joined:
    Jul 5, 2012
    Posts:
    79
    Wow, I installed the new input system and immediately my simple rolling ball test project spewed hundreds of errors. How is 'Both' Input Systems not the default when you install this thing? How is there not an upgrade script? :eek:

    Does anyone have an Upgrade Script that will translate the usual stuff into whatever is used by the new input system?
    Input.GetAxis("Horizontal")
    Input.GetKey(KeyCode.LeftControl)

    I can't even spot a Reference Table of Old Get Key keycodes -> New Keyboard.current. to use.

    Unity, this documentation is really sub-standard
    https://docs.unity3d.com/Packages/c...sdocsunity3dcomscriptreferenceinputgetkeyhtml

    Code (CSharp):
    1. Keyboard.current.aKey.wasPressedThisFrame // etc.
    Is that the 'a' key? the 'A' key? or any random key, because the rest of the example talks about the space bar.

    https://docs.unity3d.com/Packages/com.unity.inputsystem@0.9/manual/Migration.html#getAxis
    "There is no global setup corresponding exactly to "virtual axis" setups in the old player input settings."

    So that common thing, many of us use, we're just making that 10x more difficult to deal with. :mad:
     
  2. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,338
    Well, since the example you linked says this:

    Code (csharp):
    1.  
    2. Keyboard.current.spaceKey.isPressed
    3. Keyboard.current.aKey.isPressed // etc.
    4.  
    it should be really easy to figure out. If there's any confusion, yes, it's "the key a", and the further keys are things like "bKey" and "cKey", but you're really stretching the definition of "substandard" here.

    GetAxis was a pile of garbage interface. The new UI system handles it a lot better. You'll want to read the quick start docs to understand how things work, but trust me, it's a lot easier to deal with.


    @Rene-Damm, OP is raging here, but there's a point. The Input.GetAxis migration example should really deal with Horizontal/Vertical rather than Fire1, since Fire1 wasn't dealt with through GetAxis, but GetButton.