Skip to main content
Up and Coming
December 19, 2016

How can I use OVRInput.GetLocalControllerAngularVelocity to affect a rigidbody.angularVelocity?

Hi all,

I'm trying to affect a rigidbody's angular velocity (which is a Vector3) based on the current angular velocity of the touch controller.

OVRInput has a GetLocalControllerAngularVelocity method but this returns a Quaternion and not a Vector3.

If I get the Eular from the returned quaternion then it's a really high number (i'm guessing it's in degrees as well) which means the rotation is way too high when affecting the rigidbody's angular velocity.

I've also tried converting the eular to radians but that doesn't seem to work correctly either.

Does anyone know how you can get the angular velocity of the controller and apply it to a rigidbody's angular velocity?
This topic has been closed for replies.

16 replies

GEMISIS
Inspiring
February 9, 2017
@vrdaveb  Has the 2*Pi clamping issue been fixed as of yet out of curiosity?  If not, is this still on the roadmap to be fixed?

GEMISIS
Inspiring
February 10, 2017
No worries, the game I am working on for Touch is a bit far off, so as long as it is still on the road map I am okay to wait for a fix in the SDK rather than a temporary solution.  :smile: I'll keep an eye out for the feature in the future.
Up and Coming
March 12, 2018
Are there any official grabber and grabbable scripts that function properly on Gear VR controller yet or is the company still treating Gear VR like it doesn't care about it? 

I wrote a grab/carry/drop script, yet now working on the throw...and already WAAAAAAAAAY over spending days on something that SHOULD be included in the Gear VR sdk for Unity...
GEMISIS
Inspiring
March 16, 2018
I ended up writing a few tutorials on how we ended up handling grabbing with Oculus Touch on my LLC's blog. The tutorials could pretty easily be ported over to the GearVR, though from my experience GearVR doesn't operate well with those motions (generally you want 2 joints to simulate moving an arm for things like grabbing, whereas GearVR can really only simulate 1). The full code for our implementation is available on our Github page if you want to check it out.
HiroProtag0nist
Honored Contributor
June 9, 2018
To throw an object with a Touch controller i know i need velocity on the rigidbody to = OVRInput - must i use a script for this?

I've just picked Unity up again after a long time off and noticed a lot of things i used to have to use scripts for are built-in.  I'm just seeing how far i can go without scripts.  Thanks.
Big PC, all the headsets, now using Quest 3
New Participant
September 30, 2024

To use OVRInput.GetLocalControllerAngularVelocity to affect a Rigidbody's angularVelocity, follow these general steps:

  • First, retrieve the controller’s angular velocity using OVRInput.GetLocalControllerAngularVelocity.
  • Then, assign this value to your Rigidbody’s angularVelocity property.
  • Ensure that the units match, as Unity's angularVelocity expects values in radians per second.

For more complex interaction or physics adjustments, check Unity’s documentation on Rigidbody manipulation.

For further guidance on game development services, visit IConflux.