Forum Discussion
Panicaim
6 years agoHonored Guest
oculus quest controller orienting on world center [Unity3d]
I tried to write my own camera rig in unity3d but for some reason the Quest controller are orienting on the world center instead of there parent camera object
this is all my code i wrote for it
I am using oculus integration 1.8
public Transform leftController;
public Transform RightController;
public Transform camera;
// Start is called before the first frame update
void Start()
{
camera = gameObject.GetComponent<Transform>(); // i
OVRManager.display.RecenterPose(); // made this as a meaning to fix the world center problem - didn't work
}
// Update is called once per frame
void Update()
{
leftController.SetParent(camera); // i thought maybe the controller loses it parent on launch - didn't work
RightController.SetParent(camera); // i thought maybe the controller loses it parent on launch - didn't work
OVRInput.Update();
leftController.transform.localPosition = OVRInput.GetLocalControllerPosition(OVRInput.Controller.LTouch);
leftController.transform.localRotation = OVRInput.GetLocalControllerRotation(OVRInput.Controller.LTouch);
RightController.transform.localPosition = OVRInput.GetLocalControllerPosition(OVRInput.Controller.RTouch);
RightController.transform.localRotation = OVRInput.GetLocalControllerRotation(OVRInput.Controller.RTouch);
}
No RepliesBe the first to reply
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
- 3 years ago