Search Unity

Resolved Generated class from samples directory is missing LeftHand/RightHand action maps

Discussion in 'XR Interaction Toolkit and Input' started by Mandark, May 6, 2021.

  1. Mandark

    Mandark

    Joined:
    Nov 18, 2012
    Posts:
    7
    • Unity 2020.3.5f1
    • XR Interaction Toolkit Version 1.0.0-pre.3. - March 19, 2021
    • OculusXR installed
    • OpenXR installed
    After installing the XR Interaction Toolkit package I also installed the DefaultInputActions and generated a class named InputActions.cs from the DefaultInputActions asset and used it my code as follows.

    Note, there is an actionMap called LeftHand and it has an action called Primary2DAxis

    Code (CSharp):
    1.        
    2.  
    3. private InputActions _xrInput;
    4.  
    5.         private void Awake()
    6.         {
    7.             instance = this;
    8.             _xrInput = new InputActions();
    9.  
    10.             _xrInput.LeftHand.Primary2DAxis.Disable();
    11.             _xrInput.LeftHand.Primary2DAxis.performed += OnDebugMove;
    12.          
    13.             _xrInput.RightHand.Primary2DAxis.Disable();
    14.             _xrInput.RightHand.Primary2DAxis.performed += OnDebugMove;
    15.         }
    The problem
    In another project, I did the exact same thing, installed the same toolkit version, and generated the InputActions.cs class.

    But now, the InputActions.cs LeftHand actionMap is called XRILeftHand and the Primary2DAxis action is missing.

    How can I get the LeftHand/Primary2DAxis version back?

    SOLUTION:
    -
    just install Samples from the OpenXR plugin and generate InputActions.cs from the asset located here \Assets\Samples\OpenXR Plugin\1.0.3\Controller and it will have the actionMap LeftHand and the Primary2DAxis action available
    - the XR Interaction Toolkit Samples directory has a different action asset and InputActions.cs generated from it will have a different set of actionMaps prefixed with the XRILeftHand \Assets\Samples\XR Interaction Toolkit\1.0.0-pre.3\Default Input Actions
     

    Attached Files:

    Last edited: May 7, 2021