Forum Discussion
di3ension
12 years agoHonored Guest
Rotate OVR player with key input
I saw another post in the reporting issues thread but with no answer, so i thought the unity integration thread is the right place for this. With the old sdk i could rotate my ovr player by keyinput with Q and E, which is essential for me because we use a single thumbstick controler to move arround in the rift demos. But now with the new sdk there is no smooth rotation possible with Q and E. It is more like jumping to differnt angles. :(
9 Replies
Replies have been turned off for this discussion
- vrdavebOculus StaffCan you map your controller's input to the Mouse X or an XInput axis? That should still give you continuous rotation.
- di3ensionHonored GuestUnfortunately not, i have already tried to remap the stick. It would be interesting to know, what happened with the old q and e rotation and why it doesn't work anymore.
- granciaHonored GuestYou can rotate camera smoothly with changing code located the "line 315" in "OVRPlayerController.cs" like below.
//Use keys to ratchet rotation
// the variable "0.1f" is for managing rotation speed and you can define it by yourself.
if (Input.GetKey(KeyCode.Q))
YRotation -= RotationRatchet * 0.1f;
if (Input.GetKey(KeyCode.E))
YRotation += RotationRatchet * 0.1f; - di3ensionHonored GuestThx for the input, i am quite a scripting noob. The problem is, when i change the values it is still a ratchet rotation. I need a smooth roation like in the old sdk.
- CubicleNinjasProtegeFor some reason I had a ton of issues turning the OVR for rotation or movement along waypoints. One approach that worked great for me was no longer rotating the OVR. Instead, I have an object (say a cube) that isn't rendering, the OVR is a child of this, and all movement is on this parent object. I now see the results I expect, without mucking up the OVR.
- vrdavebOculus Staff
"di3ension" wrote:
It would be interesting to know, what happened with the old q and e rotation and why it doesn't work anymore.
Continuous keyboard rotation was causing nausea in our tests. However, we still support continuous gamepad rotation. Since you're not using an XBox controller, it will require a small code change. You can add Input.GetAxis("MyThumbAxis") to the following value in OVRPlayerController.UpdateMovement():
float leftAxisX =
OVRGamepadController.GPC_GetAxis((int)OVRGamepadController.Axis.LeftXAxis); - di3ensionHonored GuestIs it possible to move forward and back by mouse input using the y axis? That would be great because i have a mouse mapping for our controller.
i tried adding// Move
if (Input.GetAxis("Mouse Y")<0) moveBack =true;
if (Input.GetAxis("Mouse Y")>0) moveForward =true; - granciaHonored Guest
"di3ension" wrote:
Thx for the input, i am quite a scripting noob. The problem is, when i change the values it is still a ratchet rotation. I need a smooth roation like in the old sdk.
Please make sure you use Input.GetKey, not Input.GetKeyDown. - di3ensionHonored GuestAs you can see, a real script noob :D! Thanks alot, everything works out perfect again !!
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 3 years ago
- 8 months ago
- 2 years ago
- 6 months ago