VR gaze system from scratch, pointer didnt follow mobile “head”

Hello,

I started to make a simple VR gaze system from scratch, using Unity ARFoundation. First thing was to draw a line from my point of view to “infinity”, like a pointer. I have this script running on my AR Session Origin at Update:

    myLineRenderer.SetPosition(0, transform.position);
    myLineRenderer.SetPosition(1, transform.position+(transform.forward*1000));

This works on editor, I have a line, and I can turn and move my session origin (my “head” with camera), it follows up.

But, when I use it on mobile… the line keeps still (it shows up), doesnt turn and move with the device.

Here´s my setup:

I have defaults AR Session and Session Origin, because I will be creating AR objects (I do that in another scene too, its working, this one its another scene with two cams for vr, two canvas and so on). In one of the cams I disable the Pose Driver to avoid conflicts, but even enable (or the other components) its not working.

What´s wrong?

Oh well… nevermind. I solve it. I needed a reference to the arCameraManager, it holds the head-tracking information.

    myLine.SetPosition(0, arCameraManager.transform.position);
    myLine.SetPosition(1, arCameraManager.transform.position+arCameraManager.transform.forward*100));

o/