I was trying to throw objects with the Quest 2 Controller using the default VR template and I noticed a huge latency trying to let an object go.
The problem is that inside VRPawn the Release action is called when the grip is fully released and the oculus springs are kinda slow (slow enough to totally ruin your throw), I was wondering if there’s a way to detect a partial release (without checking the trigger value in the tick and see if it’s lower)
I tried using a button to manually release the object and it works fine, but it feels pretty unnatural. Do you have any advice?
Hey there @Ares9323! Are you using the standard input system or the advanced input system? I think if you’re using the standard input system, you could poll the trigger as an axis instead of a button and whenever it drops below pure 1.0 you use the throw function. The advanced one is a bit different, but not too far off.
I’ve had to use this a number of times for the triggers on controllers, most are very snappy, but not all.
Thank you for your answer, I’m using the standard input system!
At the moment I’m using this but I was trying to avoid polling the trigger value in every frame:
I used a boolean to avoid calling TryRelease at every frame but I was looking for something more efficient (I don’t really know how much this affects performance, I’m trying to save as much power as possible because the Quest is a mobile device, but I’m probably overthinking)
I absolutely understand! Working in a VR environment is taxing enough as it is, anything running every frame could be a problem. That said, this seems to be the only way to do it engine side unless you were using the enhanced input system. Which at this point in a project would be wild to try to change over to. With the enhanced system you can create a modifier that would do it outright, and even better wouldn’t poll the value until it was held down.
There might be another way that I’m missing, but logically we need the value from the axis to tell it’s been lifted at all, and the only way to get it is to poll it every time the hold has been applied.
Not really! I started the project from scratch few hours ago so it’s not a problem to use the Enhanced Input System or C++ (I didn’t know it existed before your previous post), I’ll try to dig deeper in it! If you have any resource to recommend it would be a great help!
Just to be sure, are you talking about this plugin?
Yep! That’s the one, there’s a couple of disclaimers I’d like to give you before you go through with it. If this is a commercial product, use this system cautiously, just like UE5 is still basically early access, so is this plugin.
Also it no longer polls axes on tick, only when they change, so if your movement code required it to kick out 0 constantly when not in use, there’ll likely be no hard problems. This system also makes it really easy to set up, save, and adjust keybinds on the fly.