docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class HapticImpulseCommandChannel

    Allows for sending haptic impulses to a channel on a device from the input system.

    Inheritance
    object
    HapticImpulseCommandChannel
    Implements
    IXRHapticImpulseChannel
    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
    public class HapticImpulseCommandChannel : IXRHapticImpulseChannel

    Properties

    device

    The input device to send the impulse to.

    Declaration
    public InputDevice device { get; set; }
    Property Value
    Type Description
    InputDevice
    See Also
    IXRHapticImpulseChannel
    SendHapticImpulseCommand

    motorChannel

    The channel to receive the impulse.

    Declaration
    public int motorChannel { get; set; }
    Property Value
    Type Description
    int
    See Also
    IXRHapticImpulseChannel
    SendHapticImpulseCommand

    Methods

    SendHapticImpulse(float, float, float)

    Sends a haptic impulse on the device if it supports sending a haptic impulse.

    Declaration
    public bool SendHapticImpulse(float amplitude, float duration, float frequency)
    Parameters
    Type Name Description
    float amplitude

    The desired motor amplitude that should be within a [0-1] range.

    float duration

    The desired duration of the impulse in seconds.

    float frequency

    The desired frequency of the impulse in Hz. A value of 0 means to use the default frequency of the device.

    Returns
    Type Description
    bool

    Returns true if successful. Otherwise, returns false.

    Remarks

    This method considers sending the haptic impulse a success (and thus returns true) if the haptic impulse was successfully sent to the device even if frequency is ignored or not supported by the device.
    Frequency is currently only functional when the OpenXR Plugin (com.unity.xr.openxr) package is installed and the input action is using an input binding to a Haptic Control.

    See Also
    IXRHapticImpulseChannel
    SendHapticImpulseCommand

    Implements

    IXRHapticImpulseChannel

    See Also

    IXRHapticImpulseChannel
    SendHapticImpulseCommand
    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)