Oculus Touch and XRController Trigger Input Actions Not Working?

I can’t seem to get trigger input actions to work for OculusTouch Left/Right Controllers or for XRController Left/Right when using Oculus Touch Controllers. I’m surprised I can’t find any mention of this anywhere in this forum. Are this working in the latest preview release?

1 Like

I’m currently using the 0.1.2 version on 2019.1.3f1 and I am reading input but I am having trouble with it.

So I didn’t have any response from joysticks on oculus until I added the invert processor to the left and down directions (I believe the reason for this is because they will “fight” each other and remain at 0 if not set to invert one direction of the axis)

But I am getting an InvalidTypeCast here

    private void OnMovementPerformed(InputAction.CallbackContext context)
    {
        Horizontal = context.ReadValue<Vector2>().x;
        Vertical = context.ReadValue<Vector2>().y;
    }

But the InvalidCastError only appears when I attempt to use the right thumbstick, when I had them both on the same thumbstick they performed really strange and didn’t throw an error and when I use the left thumstick it moves just fine, no errors but it only moves me between 180 degrees rotation and 0, it won’t go outside of that range.

It could be my movement code though… Still debugging but I can’t find much on this either so I thought i’d contribute what I knew here.

    private void OnMovementPerformed(InputAction.CallbackContext context)
    {
        Horizontal = context.ReadValue<Vector2>().x;
        Vertical = context.ReadValue<Vector2>().y;
    }

    private void OnOffensiveSpellCast(InputAction.CallbackContext context)
    {
        mps.CreateMagicBolt(mps.transform.position, mps.transform.rotation);
    }

    private void OnDisable()
    {
        controls.Gameplay.Primary_Spell_Right.performed -= OnOffensiveSpellCast;
        controls.Gameplay.Movement.performed -= OnMovementPerformed;

        controls.Disable();
    }

    private void OnEnable()
    {
        controls.Enable();
        controls.Gameplay.Movement.Enable();
        controls.Gameplay.Movement.performed += OnMovementPerformed;
        controls.Gameplay.Primary_Spell_Right.performed += OnOffensiveSpellCast;
    }

    private void FixedUpdate()
    {
        if (!IsMoving) return;
        transform.position += Direction * movementSpeed * Time.deltaTime;
        transform.rotation = Rotation;
    }

    private float Vertical { get; set; }

    private float Horizontal { get; set; }


    private bool IsMoving => Direction != Vector3.zero;

    private Vector3 Direction => new Vector3(Horizontal, 0, Vertical);

    private Quaternion Rotation => Quaternion.LookRotation(RotationDirection);

    private Vector3 RotationDirection => Vector3.RotateTowards(
        transform.forward,
        Direction,
        rotationSpeed * Time.deltaTime,
        0);
}

Oh I also have Input in the player settings set to both atm but plan to try switching it over to just the new one for testing later