I’m trying to get some basic controller vibrations working for Oculus Quest. Lots of docs are outdated and I haven’t found anything good. How can I get this working?
So far, I have had zero luck getting any vibrations been using the VR Preview. If I deploy to the Quest, I have had a little success with “spawn force feedback attached”. The vibration always seems to feel the same, and the durations always seems to extend longer than it should. The “Affects Left Large” and “Affects Right Large” work, but the flags behave like it uses the first bit found for the channel instead of having a channel effect all that are checked.
More weirdness is that I can only get it to vibrate if I initiate it via the my character BP’s Event Graph. If I try to do it from a weapon’s BP’s event graph it doesn’t work even though I am passing in the same motion controller reference as the “attach to component”.
I am using the VR Expansion Plugin (hopefully that isn’t negatively impacting my experience)
SpawnForceFeedbackAttached seems to be working, but I’m wondering if this is really what I want? Looks like I can only have one controller vibrating at a time; which matches some stuff I read that is nearly four years old. This makes me think that I don’t want to be using “ForceFeedback” to make the Quest controllers vibrate and that I instead should be trying to get haptics to work.
I found this:
and
But I do not see that as being available on my 4.25 build (oculus or standard branch)
On the first link, lower in the page, there is a deprecated warning, but I thought that perhaps that was just for the buffered part.
Is “PlayHapticEffect” really a thing? Or is it gone?
I’ve tried using the Steam VR / Magic Leap haptics. When using VR Preview these do nothing. When deploying to Quest these crash the app.
I haven’t tried. I got it working. I’m about to post the details in a moment. This area I just found very confusing with all the different docs on it. I am about 70% positive now that SpawnForceFeedback is what we should be using and that Haptics is just gone now, but I’m clearly still not very confident.
There are some weird thresholds where the result is that no feedback is given, combined with my lack of experience of what a good curve should look like. This meant that some of my attempts did nothing, but if I looped it then it did something.
The vibrations would continue even after Stop is called.
The vibrations would stop if a different vibration was initialized on a different controller. When I first witnessed this I thought I could only get vibrations on one controller at a time, but really, the second controller was just getting the first controller to actually stop. I realized this when I could still get two separate controller vibrations running at once.
I found that the best way to Stop a vibration is to play a near 0 vibration. If I tried a 0 intensity vibration or curve that was at zero, the previous vibration still would not stop.
The call to Stop IS still required, but it won’t actually stop it unless I start a near zero vibration right afterwards.
I tried using a near zero curve, and this would work for a bit, but then would break and suddenly my near-zero curve would no longer stop the vibrations.
Ultimately, the most reliable way is to play the same effect again but with an intensity of “0.001”, as using 0 also exhibited the same problem.
I’m still having issues with this. I’ve given up trying to stop it, and instead keep it cached and update the intensity. This made it a lot more stable but I still get random occurrences of the controller getting stuck as full blast intensity. I have some debug visuals and I know I am calling only the code path that I am setting it to the “off” intensity. So something I am doing is getting it into this state.