๐Ÿงต#XRRig match camera

marwi123
marcel ๐ŸŒต โ†—

Got it. This works for me:

https://xr-rig-forward-z23hmxbstnid-stnid.needle.run/

export class AlignRig extends Behaviour {

    onBeforeXR(_mode: XRSessionMode, _args: XRSessionInit): void {
        const rigs = this.context.scene.getComponentsInChildren(XRRig);
        for (const rig of rigs) {
            rig.gameObject.worldPosition = this.context.mainCamera.worldPosition;
            rig.gameObject.worldQuaternion = this.context.mainCamera.worldQuaternion;
            rig.gameObject.rotateY(Math.PI); // three camera is -z forward and rig is z forward
        }
    }
}
gilderko

ou yeah looks good thx I was trying something like this but was rotating around global Y <a:Facepalm:604043588057169940>