Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

XR Trigger not correct sending Press interactions

Discussion in 'Input System' started by Iron-Warrior, May 11, 2019.

  1. Iron-Warrior

    Iron-Warrior

    Joined:
    Nov 3, 2009
    Posts:
    838
    Hi, I'm having an issue with Press interactions when using XR Controller Triggers. The following is my setup:

    upload_2019-5-11_13-28-6.png

    I only started using the new input system yesterday, but under my understanding the above should fire the performed event on Dummy each time the trigger is pressed past the 0.5 threshold. When I replace the XR trigger with the Gamepad left trigger, it works as expected.

    When it is the XR trigger, however, it does not correctly work at all. Instead, it simply fires a single event on startup and never again. Removing the press interaction allows for the performed event to correctly fire, making me assume this is specific to the XR controller input, or an oversight on my part.

    Below is the script I am using to test.

    Code (csharp):
    1. using UnityEngine;
    2. using UnityEngine.Experimental.Input;
    3.  
    4. public class InputFun : MonoBehaviour
    5. {
    6.     private InputActions controls;
    7.  
    8.     public void Awake()
    9.     {
    10.         InputSystem.settings.updateMode = InputSettings.UpdateMode.ProcessEventsInDynamicUpdateOnly;
    11.  
    12.         controls = new InputActions();
    13.  
    14.         controls.Giant.Dummy.performed += ctx => Debug.Log(ctx.ReadValue<float>().ToString() + "-----" + Time.time);
    15.     }
    16.  
    17.     private void OnEnable()
    18.     {
    19.         controls.Enable();
    20.     }
    21.  
    22.     private void OnDisable()
    23.     {
    24.         controls.Disable();
    25.     }
    26. }
    I've enclosed my dummy project that I am using to test this. I am using an Oculus Rift with touch controllers in Unity 2019.1.2f1. Please let me know if any other information would be helpful.

    As an aside, the new input system is absolutely fantastic overall, and is a monumental leap over the old one. Great job to everyone who worked on it :)
     

    Attached Files:

  2. Fishing_Cactus

    Fishing_Cactus

    Joined:
    Nov 8, 2014
    Posts:
    45
    Same error for me with the same input configuration.

    My "jump" action is fired as soon as the trigger button is touched ( not pressed ).
    In the contex of the callback, "indextouched" button is mentioned instead of "triggerPressed".