Movement Toward Head
First, we want to grab a reference to our XRRig, so we'll grab the rig using the same method we did with the character controller at the start of the script.
Next, we'll get the head direction and then multiply our direction vector with our head directions, so that we will move the direction we're facing.
With this character controller will move toward the direction of our camera headset; however, as we move around with our camera (not our movement stick), our character capsule is not following our headset. To make the capsule follow the headset we're going to set the height of the capsule, to the height of the XR rig. We can also add a little bit of space on top of the head so that the head won't clip into anything with an additional height variable setting it to a very small number i.e) 0.1f. Next, we'll make the camera simulate being a child of the capsule center component (horizontally not vertically).
Finally, call the function at the start of the FixedUpdate function.



