Skip to content

Commit

Permalink
Haptics fixed for Vive
Browse files Browse the repository at this point in the history
  • Loading branch information
John Luxford committed Aug 27, 2017
1 parent cd803c0 commit 2ee2435
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Assets/VRKeys/Scripts/Platforms/OpenVRHaptics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ public class OpenVRHaptics : Haptics {

public override void TriggerPulse () {
int deviceIndex = (mallet.hand == Mallet.MalletHand.Left)
? SteamVR_Controller.GetDeviceIndex (SteamVR_Controller.DeviceRelation.FarthestLeft)
: SteamVR_Controller.GetDeviceIndex (SteamVR_Controller.DeviceRelation.FarthestRight);
? SteamVR_Controller.GetDeviceIndex (SteamVR_Controller.DeviceRelation.Leftmost)
: SteamVR_Controller.GetDeviceIndex (SteamVR_Controller.DeviceRelation.Rightmost);

if (deviceIndex == -1) return;

var controller = SteamVR_Controller.Input (deviceIndex);

controller.TriggerHapticPulse (800, EVRButtonId.k_EButton_Grip);
controller.TriggerHapticPulse (800);
}
}
}

0 comments on commit 2ee2435

Please sign in to comment.