Class CharacterControllerDriver
Controls a CharacterController height and center position based on the camera's (HMD) position upon locomotion events of a LocomotionProvider (typically the continuous movement provider). This allows the collider on the main XR Origin rig to resize to the player's height before trying to move with thumbstick input.
Inherited Members
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Namespace: UnityEngine.XR.Interaction.Toolkit
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
[AddComponentMenu("XR/Locomotion/Character Controller Driver", 11)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@2.5/api/UnityEngine.XR.Interaction.Toolkit.CharacterControllerDriver.html")]
public class CharacterControllerDriver : MonoBehaviour
Properties
characterController
(Read Only) The CharacterController that this class drives.
Declaration
protected CharacterController characterController { get; }
Property Value
Type | Description |
---|---|
CharacterController |
locomotionProvider
The LocomotionProvider object to listen to.
Declaration
public LocomotionProvider locomotionProvider { get; set; }
Property Value
Type | Description |
---|---|
LocomotionProvider |
maxHeight
The maximum height of the character's capsule that this behavior sets.
Declaration
public float maxHeight { get; set; }
Property Value
Type | Description |
---|---|
float |
See Also
minHeight
The minimum height of the character's capsule that this behavior sets.
Declaration
public float minHeight { get; set; }
Property Value
Type | Description |
---|---|
float |
See Also
xrOrigin
(Read Only) The Unity.XR.CoreUtils.XROrigin used for driving the CharacterController.
Declaration
protected XROrigin xrOrigin { get; }
Property Value
Type | Description |
---|---|
XROrigin |
Methods
Awake()
See MonoBehaviour.
Declaration
protected void Awake()
OnDisable()
See MonoBehaviour.
Declaration
protected void OnDisable()
OnEnable()
See MonoBehaviour.
Declaration
protected void OnEnable()
Start()
See MonoBehaviour.
Declaration
protected void Start()
UpdateCharacterController()
Declaration
protected virtual void UpdateCharacterController()