Vr player collider follow real life movement/headset

How do i make it so the players collider follows the players movement. Right now i have this to adjust the colliders hight how do i make it follow the players irl movement.
How do i make it so the players collider follows the players movement. Right now i have this to adjust the colliders hight how do i make it follow the players irl movement. ```
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PhysicRig : MonoBehaviour
{
public Transform playerHead;
public CapsuleCollider bodyCollider;
public ConfigurableJoint headJoint;
public float bodyHeightMin = 0.5f;
public float bodyHeightMax = 2f;
// Update is called once per frame
void FixedUpdate()
{
bodyCollider.height = Mathf.Clamp(playerHead.localPosition.y, bodyHeightMin, bodyHeightMax);
bodyCollider.center = new Vector3(playerHead.localPosition.x, bodyCollider.height / 2, playerHead.localPosition.z);
headJoint.targetPosition = playerHead.localPosition;
}
}