OVR character capsule not following center eye anchor

Hi to everybody.

This is my first post here. I’vr got the following problem: i am using the latest oculus integration package and unity 2021. I have an OVRPlayerController in my scene, i’ve used the prefab in the oculus locomotion scene. The problem is that when i move the head (by physicalli walking in my scene) the capsule of the character controller iss not moving accordingly. So the problem is that if i walk some steps in the physical worldwhile i am wearing my HMD, and then, i move with the joystick inside the simulation, the capsule collider of the character controller is not aligned with my head and i am colliding with objects or penetrating them.

I’ve found somebody that says to add the camera constraint script but nothing changes.

What should i do?

Thanks

EDIT: this is the script that i am using to teleport. I can not figure out how to realign character capsule collider and the camera rig after teleport. in this way i always have bad collisions because the head and the body are not aligned. I have also tried to add

OVRManager.display.RecenterPose();

in the After teleport method. This partially works because it realign the camera rig with the character capsule but it cause to ignore head rotation while teleporting.

Please help me

public class Teleporter : MonoBehaviour{
        [Header("Object to Teleport")]
        public GameObject teleportObject;

        public GameObject cameraRig;

        [Header("Aim Settings")]
        [Tooltip("The Object to Shoot the Beam From")]
        public Transform aimer;
        [Tooltip("Layers You Can Teleport On")]
        public LayerMask layer;
        [Tooltip("The Maximum Slope You Can Teleport On")]
        public float maxSurfaceAngle = 45;
        [Min(0)]
        public float distanceMultiplyer = 1;
        [Min(0)]
        public float curveStrength = 1;
        [Tooltip("Use Worldspace Must be True")]
        public LineRenderer line;
        [Tooltip("Maximum Length of The Teleport Line")]
        public int lineSegments = 50;
   
        [Header("Line Settings")]
        public Gradient canTeleportColor = new Gradient(){ colorKeys = new GradientColorKey[] { new GradientColorKey(){ color = Color.green, time = 0 } } };
        public Gradient cantTeleportColor = new Gradient(){ colorKeys = new GradientColorKey[] { new GradientColorKey(){ color = Color.red, time = 0 } } };

        [Tooltip("This gameobject will match the position of the teleport point when aiming")]
        public GameObject indicator;



        Vector3[] lineArr;
        bool aiming;
        bool hitting;
        RaycastHit aimHit;
       
      

        private void Start() {
            lineArr = new Vector3[lineSegments];
        }

        void Update()
        {
           
            if (aiming)
            {
                CalculateTeleport();
            }
            else
                line.positionCount = 0;

            DrawIndicator();
           
        }

        void CalculateTeleport() {
            line.colorGradient = cantTeleportColor;
            var lineList = new List<Vector3>();
            int i;
            hitting = false;
            for(i = 0; i < lineSegments; i++) {
                var time = i/60f;
                lineArr[i] = aimer.transform.position;
                lineArr[i] += transform.forward*time*distanceMultiplyer*15;
                lineArr[i].y += curveStrength * (time - Mathf.Pow(9.8f*0.5f*time, 2));
                lineList.Add(lineArr[i]);
                if(i != 0) {
                    if(Physics.Raycast(lineArr[i-1], lineArr[i]-lineArr[i-1], out aimHit, Vector3.Distance(lineArr[i], lineArr[i-1]), layer)) {
                        //Makes sure the angle isnt too steep
                        if(Vector3.Angle(aimHit.normal, Vector3.up) <= maxSurfaceAngle){
                            line.colorGradient = canTeleportColor;
                            lineList.Add(aimHit.point);
                            //Debug.Log(aimHit.point);
                            hitting = true;
                            break;
                        }
                        break;
                    }
                }
            }
            line.positionCount = i;
            line.SetPositions(lineArr);
           
        }

        void DrawIndicator() {
            if(indicator != null){
                if(hitting){
                    indicator.gameObject.SetActive(true);
                    indicator.transform.position = aimHit.point;
                    indicator.transform.up = aimHit.normal;
                }
                else
                    indicator.gameObject.SetActive(false);
            }
        }

        public void StartTeleport() {
            aiming = true;
        }

        public void CancelTeleport() {
            line.positionCount = 0;
            hitting = false;
            aiming = false;
        }

        public void Teleport() {
            Queue<Vector3> fromPos = new Queue<Vector3>();
            var teleportGuards = FindObjectsOfType<HandTeleportGuard>();
            foreach(var guard in teleportGuards) {
                if(guard.gameObject.activeInHierarchy)
                    fromPos.Enqueue(guard.transform.position);
            }
            if(hitting) {
                if (aimHit.collider.gameObject.tag == "Hotspot")
                {
                    teleportObject.GetComponent<CharacterController>().transform.position = aimHit.collider.transform.GetChild(0).position;
                    //aggiunta MAT
                    //OVRManager.display.RecenterPose();
                }
                else
                {
                   
                    teleportObject.GetComponent<CharacterController>().transform.position = aimHit.point;
                    //aggiunta MAT
                    //OVRManager.display.RecenterPose();


                }
               
               
            }
           
            foreach(var guard in teleportGuards) {
                if(guard.gameObject.activeInHierarchy) {
                    guard.TeleportProtection(fromPos.Dequeue(), guard.transform.position);
                }
            }
            CancelTeleport();
            AfterTeleport();
        }

        void AfterTeleport() {
            var mainCam = Camera.main;
            //OVRManager.display.RecenterPose();
        }
    }

Hello Sirimat, did you managed to get this working?
Or anyone?

Thanks!

I have exactly the same problem. Collider is not centered on the headset after a phisical walk. Also after a physical walk, the rotation is around the collider and not the headset anymore.
Did somebody manage to solve this problem?

Same problem here…