I’m new to the XR Interaction Toolkit, and I started using continuous movement, so I added a character controller so you can crawl, but It just floats at 0.5 Y. Does anyone know why this is happening?

I’m new to the XR Interaction Toolkit, and I started using continuous movement, so I added a character controller so you can crawl, but It just floats at 0.5 Y. Does anyone know why this is happening?
Update: I disabled everything else in the scene other than the floor, and it was still floating
The Character Controller component has a capsule collider to represent the character which is centered on the XR Rig. The XR Rig transform position is located at the ground, so what is likely happening is the capsule collider is going through the ground by a distance of half its height if the Center value is (0, 0, 0), which then moves the XR Rig up to make it stop overlapping with your floor geometry.
There is a Character Controller Driver component in XR Interaction Toolkit that you can use to automatically set the center and height of the Character Controller based on the camera position so that the capsule collider will span between the XR Rig ground and the camera instead of poking through the floor. You may also need to adjust the Skin Width on the Character Controller.
I’m encountering the same issue - but I can’t follow your advice.
Upon entering Play mode, the Character Controller’s Center, Radius, and Height are automatically changed. (Same with the XR Origin and Camera Offset positions)
My settings:
After pressing play:
As you can see in this demonstration, as soon as I begin continuous movement the whole rig moves up 0.5 units.
g5n9hh
Using:
Unity 2020.3.30f1
XR Interaction Toolkit 2.0.2
OpenXR Plugin 1.3.1
Oculus Quest 1 device.
What should I do?
It looks like your Character Controller Driver component is referencing the Teleportation Provider instead of the Continuous Move Provider, so it isn’t responding correctly to the move events from the latter. You’ll need to change it so it references the right component.
If you drag your Locomotion System GameObject to the Locomotion Provider field of the Character Controller Driver, Unity will pick the first (top) component that matches of which I’m guessing you have multiple, so you will need to reorder that Continuous Move Provider component to move it above the Locomotion Provider component so it will pick the right one when you drag-and-drop the GameObject. Alternatively, you can open a second Inspector window, lock the selection on one with the padlock button, and drag the Continuous Move Provider component from one Inspector window to the other.
The CharacterControllerDriver.Awake
method only tries to find the ContinuousMoveProviderBase
on the same GameObject when the field isn’t set. I’ll add a task to our backlog so we can change it to find it anywhere in the scene instead to help with setup in a future version.
Thank you! That cleared it up.
For future readers of the thread:
I put the Teleport Provider, Continuous Move Provider, even the two turn providers on their own child objects. I’ll set up a toggle for the player to select which movement/turn style they prefer by activating/deactivating the appropriate child object.
Note: I put the Locomotion System on the XR Origin game object, and it works fine there.