- Home /
Haptic feedback on HTC Vive controller
How do you get the vive controller to generate a haptic feedback?
Answer by mptp · Apr 15, 2016 at 01:58 AM
You want the function
SteamVR_Controller.Input([the index of the controller you want to vibrate]).TriggerHapticPulse([length in microseconds as ushort]);
Note that the haptic pulse length in my experience must be between 1-3999 (inclusive).
Also, I suggest you look through the example scripts in the SteamVR plugin to learn about how to access SteamVR functionality - there's no documentation, but the reference scripts are a great place to learn how to get stuff done!
How do you get the index of the controller? I added S$$anonymous$$mVR_TrackedController to both the controllers (it wasnt there by default for some reason) and I tried getting the controllerIndex but then I get a type conversion from uint to int. Should I cast it? Why aren't they the same type?
Hey myxolobe, yeah you can just cast the uint to int, I'm fairly sure if you get the index as a parameter of S$$anonymous$$mVR_TrackedObject it will never be negative.
Your answer
Follow this Question
Related Questions
[Solved] SteamVR - Replacing the Vive controller texture/model IN Unity? 1 Answer
First Person Player controller for Steam VR 1 Answer
SteamVR first/thirfd person for multiplayer 0 Answers
HTC Vive Controller Twist - Extracting Angular Velocity On The Correct Axis 0 Answers
Rotate object based on rotation of SteamVR Controller? 2 Answers