Is using a rigidbody/collider based movement script with an XR Rig that has a non-relative XR camera possible?

What do I have?

I have a typical XR Rig parent gameObject with a camera as a child object.
The XR Rig parent gameObject has a Rigidbody, Collider and movement script to allow locomotion via joystick and a camera set as a Generic XR Device and to NOT use relative transform.

What do I see?

When I click on play, the camera starts in a different x,z position to the XR Rig.
This becomes apparent when comparing the visible location of the XR Rig collider despite both Rig and Camera being in the same place in the editor before hitting play.

What do I want to achieve?

I want to be able to use room scale so that the player can physically move to move the player as well as using a joystick for main locomotion.

The problem?

To use a joystick for locomotion requires the camera child object to move with the parent rig gameObject, which has the movement controller script attached to it. That works fine, but in order to get the collider that is attached to the XR Rig parent to be in the right place for collision, i.e where the camera is, you would need to move the Rig to be in the same place as the camera so that when you physically move the collider attached to the parent rig it would be in the right place.

What have I tried?

On the main rig, I have tried

public Transform camera;

void Update()
    {
 gameObject.transform.position = new Vector3(camera.position.x, camera.position.y, camera.position.z);
}

This causes the player to ‘fly off’ in a direction, presumably because of the camera being a child object of the rig I’m trying to move that has the camera in it?

Just out of interest, to see what would happen, I tried to set the camera position to being the position of the rig using the script above on the camera, using the XR Rig parent gameobject , and the camera position was still away from the rig, i.e nothing changed.

Would the only option be something like trying to set the parent XR Rig gameObjects collider offset dynamically to keep it where the camera transform is? If that is even possible.

Any ideas would be welcome.

Just some thoughts. The problem is that the camera WILL move when the user move the head, having a collider will not change that. So having room scale movement and not sitting/standing still movement (which will also be a problem if you move too far from a initial centered position) together with joystick movement is conflicting with that. A solution that some games uses is to detect collisions and push the camera back so you don’t end up inside objects.

I’m having this same issue, I can’t offer any help at the moment but I am working on it and will let you know if I come up with anything.