docs.unity3d.com
    Show / Hide Table of Contents

    Capturing player inputs using the input manager

    To use units from the input system (input manager), the Input unit must be linked from its output data port or its input trigger to a unit. To use the old input system, set the Edit > Project Settings > Player > Active Input Handling to Input Manager (Old) or Both.

    Note: The Input Manager (Edit > Project Settings > Input Manager) lists all the input types.

    To enter an input in the system

    1. In a script graph that has an Event unit (for example Update Event), right-click on an empty spot on the graph.
      A command list appears.
    2. Select Add Unit. The fuzzy finder appears.
    3. In the search field, enter “get axis”.
    4. Select Input: Get Axis.
      The Get Axis unit appears on the graph.
    5. Label the unit in the axisName field (for example Horizontal).
      WARNING: You must label the unit with the exact spelling of the units listed in the Input Manager or Unity does not recognize them.
      TIP: Copy and paste the input unit name to ensure the spelling is correct.
    6. Drag the output port from an event unit to the input port of the Input unit. Release the arrow (mouse button) so the two units are connected.
      Note: Every time there is a frame cycle and if the data port is used, the Input unit receives a signal.
    7. From the Get Axis unit, drag from the output trigger port to an input port in another unit (for example a Transform unit).
      Every time the user clicks the key for the Get Axis unit (for example, the left or right arrow), the downstream unit increments.

    Creating an input unit using this method might not guarantee you’ve selected a unit that is compatible with the selected event. Use the fuzzy finder by dragging from the event output port:only compatible units (that is, units that can be linked from that event) appear in the fuzzy finder.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023