Search Unity

Question Check if controller is off?

Discussion in 'XR Interaction Toolkit and Input' started by james_lue, Oct 15, 2020.

  1. james_lue

    james_lue

    Joined:
    Mar 25, 2020
    Posts:
    2
    Is there a way to check if controller is turned off?
    I want to ignore the TrackedPoseDriver's data for the controller if the controller is off.

    Thanks
     
  2. FakeByte

    FakeByte

    Joined:
    Dec 8, 2015
    Posts:
    147
    You could check the tracking state to see if the controller is tracking, this doesnt mean it is turned off, but its probably the closest you get.
    controller.trackingState == TrackingState.None

    If you use oculus integration or steam vr you can get more controller info from there.
     
  3. james_lue

    james_lue

    Joined:
    Mar 25, 2020
    Posts:
    2
    Hi FakeByte,

    I couldn't find the trackingState property in TrackedPoseDriver, could you tell me what class you are using?
    https://docs.unity3d.com/2018.3/Documentation/ScriptReference/SpatialTracking.TrackedPoseDriver.html

    Thanks
     
  4. FakeByte

    FakeByte

    Joined:
    Dec 8, 2015
    Posts:
    147
    james_lue likes this.