Forum Discussion
rsanfeliu
11 years agoHonored Guest
Intercept XBox controller induced rotation only?
Hi!
Noob question. I want my camera to get the same "feel" as it does natively with an XBox Controller (right joystick + Head Tracking rotates camera), but I need to somehow intercept the rotation of the camera induced by the controller only, and not the Head Tracking.
My aim here is to emulate the rotation of the whole body with the joystick, and the head with the tracker, so I would be able to align an object with the body, but not necessarily the head. Think about this as if I was mapping a character model to the camera so the player can see his legs. They have to be aligned with the body of the player (of course), but not the head, and when he turns his head without touching the joystick, his body does not turns. When he wants to move his whole body, he uses the joystick.
My first idea was to disable the OVR Xbox controller, and create my own, so I could interecpt the induced rotation and use it.
So I tried to uncheck "Tracker Rotates Y" from the camera controller and follow the orientation of a empty GameObject, which would rotate around Y axis according to the XBox Joystick input. I disabled the OVRGamepardController script, built my own and managed to make the GameObject rotating, but the camera does not follow my GameObject.
I tried to act directly the PlayerController's transform, CameraController, CameraLeft/Right... Nothing goes. Everything is always reset to the tracker values.
Has somebody faced the same questions, or has any idea about this?
Thanks! :)
Noob question. I want my camera to get the same "feel" as it does natively with an XBox Controller (right joystick + Head Tracking rotates camera), but I need to somehow intercept the rotation of the camera induced by the controller only, and not the Head Tracking.
My aim here is to emulate the rotation of the whole body with the joystick, and the head with the tracker, so I would be able to align an object with the body, but not necessarily the head. Think about this as if I was mapping a character model to the camera so the player can see his legs. They have to be aligned with the body of the player (of course), but not the head, and when he turns his head without touching the joystick, his body does not turns. When he wants to move his whole body, he uses the joystick.
My first idea was to disable the OVR Xbox controller, and create my own, so I could interecpt the induced rotation and use it.
So I tried to uncheck "Tracker Rotates Y" from the camera controller and follow the orientation of a empty GameObject, which would rotate around Y axis according to the XBox Joystick input. I disabled the OVRGamepardController script, built my own and managed to make the GameObject rotating, but the camera does not follow my GameObject.
I tried to act directly the PlayerController's transform, CameraController, CameraLeft/Right... Nothing goes. Everything is always reset to the tracker values.
Has somebody faced the same questions, or has any idea about this?
Thanks! :)
2 Replies
Replies have been turned off for this discussion
- vrdavebOculus StaffDisable "Tracker Rotates Y" and use OVRPlayerController.
- rsanfeliuHonored GuestOk, After a bit of testing, I stumbled upon two things.
1/
I unchecked "Tracker Rotates Y" and made it follow my "CameraDirection" custom game object, which is currently rotating on its own (using a script). Nothing happens, the camera never follows my game object UNLESS I activate the OVR Camera Controller script at runtime. Then, it picks up with the current direction of my GameObject and it's working fine.
2/
For now the Game Object is rotating on its own; I'd like to keep almost everything from the OVR Gamepad Controller but prevent the Right Y Axis to be listened and followed automatically by the camera (so I can do my own business with it). Can I edit the code from this script to do such thing? I tried this, but it does nothing.
public static float GPC_GetAxis(int axis)
{
print ("Get Axis");
if (!OVRDevice.SupportedPlatform || axis == (int) Axis.RightXAxis)
return 0.0f;
return OVR_GamepadController_GetAxis(axis);
}
@vrdaveb Also, rotating the PlayerController does not work for me. I have to use he "Follow Direction" option.
FYI, I'm with SDK 0.4.1, DK1 and Unity Pro 4.5.4f1.
EDIT: Sorry, it's SDK 0.4.2, I mis-typed
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
- 6 months ago