Search Unity

How to map thumbstick axis to a button action

Discussion in 'New Input System' started by Clavus, Feb 8, 2020.

  1. Clavus

    Clavus

    Joined:
    Jun 6, 2014
    Posts:
    23
    I'm trying to map 'pushing the thumbstick up' to a specific action, but I can't quite see how I go about doing this in this system. So basically if "thumbstick y > 0.5" then trigger the action.
     
  2. Clavus

    Clavus

    Joined:
    Jun 6, 2014
    Posts:
    23
    If this isn't supported, please consider this a feature request then.
     
  3. Rene-Damm

    Rene-Damm

    Unity Technologies

    Joined:
    Sep 15, 2012
    Posts:
    974
    There's up/down/left/right child controls on each of the sticks which you can bind to.

    upload_2020-2-13_18-14-46.png
     
  4. Clavus

    Clavus

    Joined:
    Jun 6, 2014
    Posts:
    23
    Hm these appear to be available for the gamepad but I'm not seeing them for the thumbstick on the XRController, which is the one I need.
     
  5. Rene-Damm

    Rene-Damm

    Unity Technologies

    Joined:
    Sep 15, 2012
    Posts:
    974
    What's the device? Oculus Touch?

    Looking at the code, that one indeed sets up the stick as a simple Vector2Control instead of as a StickControl. Looks wrong. Checking with XR team.
     
unityunity