docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class XRInputHapticImpulseProvider

    Serializable haptic impulse provider that allows for specifying the output channel or device for haptic impulses. Behaviors can declare a field of this type to allow them to output haptic impulses to a controller specified by an input action or any other source capable of returning a group of haptic channels.

    Inheritance
    object
    XRInputHapticImpulseProvider
    Implements
    IXRHapticImpulseProvider
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.XR.Interaction.Toolkit.Inputs.Haptics
    Assembly: Unity.XR.Interaction.Toolkit.dll
    Syntax
    [Serializable]
    public class XRInputHapticImpulseProvider : IXRHapticImpulseProvider

    Constructors

    XRInputHapticImpulseProvider()

    Initializes and returns an instance of XRInputHapticImpulseProvider.

    Declaration
    public XRInputHapticImpulseProvider()

    XRInputHapticImpulseProvider(string, bool, InputSourceMode)

    Initializes and returns an instance of XRInputHapticImpulseProvider.

    Declaration
    public XRInputHapticImpulseProvider(string name = null, bool wantsInitialStateCheck = false, XRInputHapticImpulseProvider.InputSourceMode inputSourceMode = InputSourceMode.InputActionReference)
    Parameters
    Type Name Description
    string name

    The name of the directly serialized embedded input action.

    bool wantsInitialStateCheck

    Whether the action should start performing if already actuated when the action is enabled.

    XRInputHapticImpulseProvider.InputSourceMode inputSourceMode

    The initial input source mode.

    Properties

    inputAction

    The directly serialized embedded input action that is read to identify the output channels of a device when the mode is set to InputAction.

    Declaration
    public InputAction inputAction { get; set; }
    Property Value
    Type Description
    InputAction

    inputActionReference

    The reference to an input action that is read to identify the output channels of a device when the mode is set to InputActionReference.

    Declaration
    public InputActionReference inputActionReference { get; set; }
    Property Value
    Type Description
    InputActionReference

    inputSourceMode

    The mode that determines from which input source to get the haptic channels. By default this is set to InputActionReference to read from an input action defined in the project.

    Declaration
    public XRInputHapticImpulseProvider.InputSourceMode inputSourceMode { get; set; }
    Property Value
    Type Description
    XRInputHapticImpulseProvider.InputSourceMode
    See Also
    XRInputHapticImpulseProvider.InputSourceMode

    Methods

    DisableDirectActionIfModeUsed()

    Disable the directly serialized embedded input action if the mode is set to InputAction.

    Declaration
    public void DisableDirectActionIfModeUsed()
    See Also
    EnableDirectActionIfModeUsed()

    EnableDirectActionIfModeUsed()

    Enable the directly serialized embedded input action if the mode is set to InputAction.

    Declaration
    public void EnableDirectActionIfModeUsed()
    See Also
    DisableDirectActionIfModeUsed()

    GetChannelGroup()

    Gets the group of haptic impulse channels.

    Declaration
    public IXRHapticImpulseChannelGroup GetChannelGroup()
    Returns
    Type Description
    IXRHapticImpulseChannelGroup

    Returns the haptic impulse channel group, which may be null.

    GetObjectReference()

    Gets the object reference that is used as the input source to identify the output channels of a device when the mode is set to ObjectReference.

    Declaration
    public IXRHapticImpulseProvider GetObjectReference()
    Returns
    Type Description
    IXRHapticImpulseProvider

    Returns the object reference, which may be null.

    SetObjectReference(IXRHapticImpulseProvider)

    Sets the object reference that is used as the input source to identify the output channels of a device when the mode is set to ObjectReference.

    Declaration
    public void SetObjectReference(IXRHapticImpulseProvider value)
    Parameters
    Type Name Description
    IXRHapticImpulseProvider value

    The object reference.

    Remarks

    If the argument is to be serialized, it must be a Unity Object type.

    Implements

    IXRHapticImpulseProvider
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)