Search Unity

Official "How Do I....?"

Discussion in 'Input System' started by Rene-Damm, Sep 16, 2021.

  1. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    As part of a first step to making our documentation more useful, we're rewriting the "How Do I...?" section of the manual.

    There's a work-in-progress version here. Still very unfinished and several parts of the content are still missing. Links to external content don't work (will once it's incorporated into the manual structure).

    If you have thoughts, happy to hear from you. Anything goes. "I wish it would include X." "I don't understand the explanation for Y." "I wish it was more like these docs I've seen over here." Whatever. Even if it isn't really about that particular page but rather the docs in general.

    (Please ignore the styling; will change once it's incorporated into the manual)
     
    Last edited: Sep 16, 2021
    NotaNaN, my_little_kafka and Olmi like this.
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,447
    looks great.. good to see many gifs and script snippets..

    random ideas that i might like to see:
    - how to convert old system to new / how to replace GetKeyDown / getmousebutton..etc /
    - how to read common buttons from script alone (without using any input editors or such)
    - do i need to multiply new input received values with time.deltaTime
    - simple demo script (moving player around, script alone)
    - using desktop touchscreen how to?
    - how to optimize (i havent used the new input system, but i'd suspect its more complicated and possibly has more pitfalls for wasting cpu time if do something the wrong way?)
    - can i use it in editor scripts?
    - how to handle diagonal movement (so that its the same speed)
     
    Olmi, NotaNaN and my_little_kafka like this.
  3. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    That's great, what I'd like to see is:

    - how to change/set axis gravity and sensitivity
     
    JvanE likes this.
  4. nikescar

    nikescar

    Joined:
    Nov 16, 2011
    Posts:
    165
    Nice idea, thanks!

    It would be cool to see the many different ways to use the input system and why each way would be chosen.

    There's inheriting from the IActionMap, subscribing to started/performed/cancelled, using Input action reference, and so on. One of my favorite things about the new InputSystem is how flexible it is but that also made it tougher to comes to grip with when I first started using it.

    Oh, and also the recommended way to detect input device changes to swap UI assets
     
    NotaNaN and my_little_kafka like this.
  5. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Thank you for the input! Taken into consideration.
     
  6. my_little_kafka

    my_little_kafka

    Joined:
    Feb 6, 2014
    Posts:
    87
    This is a great idea! The new Input System is a lot better than the old one, but the documentation is lacking and it leads to a lot of frustration during the developing. The existing examples could be very daunting to non–programmers and beginners, and the simplest things that could be needed for the development are absent from the examples (but this new «How do I...» page looks very great and beginner–friendly).

    Seconding nikescar's suggestion about the recommended way to detect input device changes, I had to browse through this forum a lot to find a working solution.
     
  7. Fressno

    Fressno

    Joined:
    Mar 31, 2015
    Posts:
    185
    I would like a further detail in how to check for runtime controller detection.
     
  8. bb8_1

    bb8_1

    Joined:
    Jan 20, 2019
    Posts:
    100
    Started recently to use new input system - how to add PlayerInput system/asset component to the game object at the runtime thru the code ofc?
     
  9. dlorre

    dlorre

    Joined:
    Apr 12, 2020
    Posts:
    699
    How do I make a controller/gamepad input that does not send two events (such as D-Left and D-Up) at the same time?

    While I have my idea on how to do that (such as disabling the events until the first is canceled) I think maybe there would be a simpler/better solution.