Jump to content

csca

Members
  • Posts

    1
  • Joined

  • Last visited

Posts posted by csca

  1. Hey,

     

    I have implemented a basic scene for head and controller tracking for the Vive Focus Plus.

    For the controllers I have created 2 gameobjects and attached the WaveVR_DevicePoseTracker and WaveVR_ControllerPoseTracker scripts.

    I have added the WaveVR_ButtonList Scripts to antoher game object and registered the trigger and grip buttons for both controllers.

    When I try to get information about button presses with this script:

     

    public class WaveVR_ControllerDebug : MonoBehaviour
    {
        public List<string> states;
        private WaveVR_Controller.Device controllerLeft;
        private WaveVR_Controller.Device controllerRight;
        // Start is called before the first frame update
        void Start()
        {
            controllerLeft = WaveVR_Controller.Input(WaveVR_Controller.EDeviceType.NonDominant);
            controllerRight = WaveVR_Controller.Input(WaveVR_Controller.EDeviceType.Dominant);
        }
    
        // Update is called once per frame
        void Update()
        {
            states.Clear();
            foreach(WaveVR_ButtonList.EButtons button in Enum.GetValues(typeof(WVR_InputId))) {
                states.Add(button + " " + controllerRight.GetPress(button));
                states.Add(button + " " + controllerLeft.GetPress(button));
            }
        }
    }

     

    it will show all button presses as type Unavailable (0) when running direct preview.

     

    image.png.a441b6325aa79055b3df6f4bc2326844.png

    It also shows InputId as 0 for all button presses in the log.

    Am I missing scripts to make this work? Or is there a more reliable way to grab controller presses? I need to keep the controller integration as simple and minimal as possible.

     

    @Tony PH Lin @Cotta

×
×
  • Create New...