Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Get Axis input from Hotas, Thrustmaster T1600m joystick and throttle

Discussion in 'Input System' started by DE_Hizral, Mar 10, 2022.

  1. DE_Hizral

    DE_Hizral

    Joined:
    Feb 21, 2020
    Posts:
    19

    Hello all, I is there a way for me to get a direct input from my Hotas. I have a Thrusmaster T1600m joystick and throttle.

    for the joystick input, I did try to get the input by getting the raw axis but my axis x and y not working correctly.
    Code (CSharp):
    1. //JOYSTICK CODE
    2.                 fAxisX = Input.GetAxisRaw("Joy1X") * fScale;
    3.                 fAxisY = Input.GetAxisRaw("Joy1Y") * fScale;
    4.                 tJoystick.localRotation = Quaternion.Euler(fAxisX, 0, fAxisY);
    1. if I do like the code above the object will move but the problem is the object will just snap on the axis that being push
    1646904690245.gif
    2. but for some reason why is my axis x and y getting same input, if I push the X axis Y axis is being effected

    Code (CSharp):
    1. //JOYSTICK CODE
    2.                 fAxisX = Input.GetAxisRaw("Joy1X") * fScale;
    3.                 fAxisY = Input.GetAxisRaw("Joy1Y") * fScale;
    4.                 //tJoystick.localRotation = Quaternion.Euler(fAxisX, 0, fAxisY);
    5.                 tJoystick.localRotation =
    6.                     Quaternion.Lerp(Quaternion.Euler(tJoystick.eulerAngles.x, 0, tJoystick.eulerAngles.y),
    7.                     Quaternion.Euler(fAxisX, 0, fAxisY), Time.deltaTime);
    1646904783317.gif
    3. then I change my code to the above the movement is not that snappy but still the issues with the axis x and y getting same input, I can only push to only one axis.

    4. and final question for the throttle how do I get the z axis input(throttle being push front and back), because in Unity you can only get x and y axis.

    Thank you.
     
    Last edited: Mar 10, 2022
  2. DE_Hizral

    DE_Hizral

    Joined:
    Feb 21, 2020
    Posts:
    19
  3. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,548
    1. Have you installed the latest drivers from ThrustMaster?

    https://support.thrustmaster.com/en/product/t-16000m-fcs-hotas-en/

    Drivers - Package 2021_TFHT_2 + Firmware [System Requirement: Windows® 10 / 11]


    2. I do not think the new input system supports direct input only raw input. Rewired supports direct input in addition to raw and those combination of controllers are directly supported. I have used both of those controllers with Rewired without any issues in the past.

    Scroll down to flight controllers on this list.

    https://guavaman.com/projects/rewired/docs/SupportedControllers.html

    There is also a free trial of Rewired if you want to use it verify your hardware is working as expected.

    https://guavaman.com/projects/rewired/trial.html