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
UnityEngine.Component.GetComponentInParent<T>(System.Boolean)
UnityEngine.Object.FindObjectsByType<T>(UnityEngine.FindObjectsSortMode)
UnityEngine.Object.FindObjectsOfType<T>(System.Boolean)
UnityEngine.Object.FindObjectsByType<T>(UnityEngine.FindObjectsInactive, UnityEngine.FindObjectsSortMode)
UnityEngine.Object.FindObjectOfType<T>(System.Boolean)
UnityEngine.Object.FindFirstObjectByType<T>()
UnityEngine.Object.FindAnyObjectByType<T>()
UnityEngine.Object.FindFirstObjectByType<T>(UnityEngine.FindObjectsInactive)
UnityEngine.Object.FindAnyObjectByType<T>(UnityEngine.FindObjectsInactive)
Namespace: UnityEngine.XR.Interaction.Toolkit
Syntax
[AddComponentMenu("XR/Locomotion/Character Controller Driver", 11)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@2.4/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 |
---|---|
Single |
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 |
---|---|
Single |
See Also
xrOrigin
(Read Only) The 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()