oculus quest controller orienting on world center [Unity3d] — Oculus
IMPORTANT:

All Oculus Quest developers MUST PASS the concept review prior to gaining publishing access to the Quest Store and additional resources. Submit a concept document for review as early in your Quest application development cycle as possible: https://developer.oculus.com/quest-pitch/

For additional information and context, please see "Submitting Your App to the Oculus Quest Store".
Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

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);
    }

Sign In or Register to comment.