Search Unity

Read Axis directly from a custom controller

Discussion in 'Input System' started by GoesTo11, Mar 10, 2021.

  1. GoesTo11

    GoesTo11

    Joined:
    Jul 22, 2014
    Posts:
    604
    How do I read an Axis directly from a custom controller? I am currently using the old input system. I have a custom controller created with a Leo Bodnar BU0836-LC Load Cell Joystick Controller. I would like to read values from axis labelled as [x] and [Slider] in DIView.

    From Input.GetJoystickNames() it is Element 2 which I am guessing is Joystick 3. Can I read the values that it is giving directly or do I need to assign the controller in the Input Manager? And if I need to assign them in the input manager, how do I do it? I've tried Joystick 3 and checking the different Axis but I cannot find the correct one.

    Thanks
     
  2. Have you tried to check the debugger window? Maybe that will tell you what device and what parameters.
    https://docs.unity3d.com/Packages/com.unity.inputsystem@1.0/manual/Debugging.html
     
  3. GoesTo11

    GoesTo11

    Joined:
    Jul 22, 2014
    Posts:
    604
    It took me a while to get to this. Thanks for the reply. The debugger window looks like it is only for the new input system. I gave the new input system a go and was able to read the values from my load cells. But that broke some custom things I did with the old input system to get screen space an VR UI interactions to work the way I wanted. But I was able to find a way to get that work relatively simply with UnityXR but now that has broken my vive trackers. So now I either need to figure out how to get the vive trackers working in the new UnityXR/OpenXR or figure out how to read the load cell values using the old input system.
     
  4. arfish

    arfish

    Joined:
    Jan 28, 2017
    Posts:
    782
  5. GoesTo11

    GoesTo11

    Joined:
    Jul 22, 2014
    Posts:
    604
    That works quite nicely. Thanks!