docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class OpenXRInteractionFeature

    A Unity OpenXR Interaction feature. This class can be inherited from to add a custom action mapping for OpenXR.

    Inheritance
    object
    Object
    ScriptableObject
    OpenXRFeature
    OpenXRInteractionFeature
    DPadInteraction
    EyeGazeInteraction
    HPReverbG2ControllerProfile
    HTCViveControllerProfile
    HandCommonPosesInteraction
    HandInteractionProfile
    KHRSimpleControllerProfile
    MetaQuestTouchPlusControllerProfile
    MetaQuestTouchProControllerProfile
    MicrosoftHandInteraction
    MicrosoftMotionControllerProfile
    OculusTouchControllerProfile
    PalmPoseInteraction
    ValveIndexControllerProfile
    MockAdditiveFeature
    Inherited Members
    OpenXRFeature.enabled
    OpenXRFeature.xrGetInstanceProcAddr
    OpenXRFeature.HookGetInstanceProcAddr(IntPtr)
    OpenXRFeature.OnSubsystemCreate()
    OpenXRFeature.OnSubsystemStart()
    OpenXRFeature.OnSubsystemStop()
    OpenXRFeature.OnSubsystemDestroy()
    OpenXRFeature.OnSystemChange(ulong)
    OpenXRFeature.OnSessionCreate(ulong)
    OpenXRFeature.OnAppSpaceChange(ulong)
    OpenXRFeature.OnSessionStateChange(int, int)
    OpenXRFeature.OnSessionBegin(ulong)
    OpenXRFeature.OnSessionEnd(ulong)
    OpenXRFeature.OnSessionExiting(ulong)
    OpenXRFeature.OnSessionDestroy(ulong)
    OpenXRFeature.OnInstanceDestroy(ulong)
    OpenXRFeature.OnSessionLossPending(ulong)
    OpenXRFeature.OnInstanceLossPending(ulong)
    OpenXRFeature.OnFormFactorChange(int)
    OpenXRFeature.OnViewConfigurationTypeChange(int)
    OpenXRFeature.OnEnvironmentBlendModeChange(XrEnvironmentBlendMode)
    OpenXRFeature.PathToString(ulong)
    OpenXRFeature.StringToPath(string)
    OpenXRFeature.GetCurrentInteractionProfile(ulong)
    OpenXRFeature.GetCurrentInteractionProfile(string)
    OpenXRFeature.GetCurrentAppSpace()
    OpenXRFeature.GetViewConfigurationTypeForRenderPass(int)
    OpenXRFeature.SetEnvironmentBlendMode(XrEnvironmentBlendMode)
    OpenXRFeature.GetEnvironmentBlendMode()
    OpenXRFeature.GetValidationChecks(List<OpenXRFeature.ValidationRule>, BuildTargetGroup)
    OpenXRFeature.CreateSubsystem<TDescriptor, TSubsystem>(List<TDescriptor>, string)
    OpenXRFeature.StartSubsystem<T>()
    OpenXRFeature.StopSubsystem<T>()
    OpenXRFeature.DestroySubsystem<T>()
    OpenXRFeature.OnEnable()
    OpenXRFeature.OnDisable()
    OpenXRFeature.Awake()
    OpenXRFeature.GetAction(InputAction)
    OpenXRFeature.GetAction(InputDevice, InputFeatureUsage)
    OpenXRFeature.GetAction(InputDevice, string)
    OpenXRFeature.RegisterStatsDescriptor(string, OpenXRFeature.StatFlags)
    OpenXRFeature.SetStatAsFloat(ulong, float)
    OpenXRFeature.SetStatAsUInt(ulong, uint)
    ScriptableObject.SetDirty()
    ScriptableObject.CreateInstance(string)
    ScriptableObject.CreateInstance(Type)
    ScriptableObject.CreateInstance<T>()
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.InstantiateAsync<T>(T)
    Object.InstantiateAsync<T>(T, Transform)
    Object.InstantiateAsync<T>(T, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int)
    Object.InstantiateAsync<T>(T, int, Transform)
    Object.InstantiateAsync<T>(T, int, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, int, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, Transform, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, InstantiateParameters)
    Object.InstantiateAsync<T>(T, int, InstantiateParameters)
    Object.InstantiateAsync<T>(T, Vector3, Quaternion, InstantiateParameters)
    Object.InstantiateAsync<T>(T, int, Vector3, Quaternion, InstantiateParameters)
    Object.InstantiateAsync<T>(T, int, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>, InstantiateParameters)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Scene)
    Object.Instantiate<T>(T, InstantiateParameters)
    Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsByType<T>(FindObjectsSortMode)
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindFirstObjectByType<T>()
    Object.FindAnyObjectByType<T>()
    Object.FindFirstObjectByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.XR.OpenXR.Features
    Assembly: Unity.XR.OpenXR.dll
    Syntax
    [Serializable]
    public abstract class OpenXRInteractionFeature : OpenXRFeature

    Properties

    IsAdditive

    Flag that indicates this feature or profile is additive and its binding paths will be added to other non-additive profiles if enabled.

    Declaration
    protected virtual bool IsAdditive { get; }
    Property Value
    Type Description
    bool

    Set to true if the actions in the profile can be added to other enabled interaction profiles. Defaults to false.

    Methods

    AddActionMap(ActionMapConfig)

    Add an action map to the Unity Input System.

    This method must be called from within the RegisterActionMapsWithRuntime method.

    Declaration
    protected void AddActionMap(OpenXRInteractionFeature.ActionMapConfig map)
    Parameters
    Type Name Description
    OpenXRInteractionFeature.ActionMapConfig map

    Action map to add

    AddAdditiveActions(List<ActionMapConfig>, ActionMapConfig)

    Override this method to augment other enabled interaction profiles with the additive action bindings provided by this interaction feature.

    Declaration
    protected virtual void AddAdditiveActions(List<OpenXRInteractionFeature.ActionMapConfig> actionMaps, OpenXRInteractionFeature.ActionMapConfig additiveMap)
    Parameters
    Type Name Description
    List<OpenXRInteractionFeature.ActionMapConfig> actionMaps

    The set of action maps from all enabled non-additive interaction profiles that can be augmented.

    OpenXRInteractionFeature.ActionMapConfig additiveMap

    The action map defined by an additive feature that contains extra actions/binding paths intended to be appended to existing non additive interaction profiles.

    Remarks

    The stock interaction profiles provide a complete set of actions and bindings for different types of input. They are typically the primary profile for a device (for example, the Oculus Touch Controller Profile for the Quest 2 and the Meta Quest Touch Pro Controller Profile for the Quest Pro). At runtime, the device runtime chooses its preferred profile from those enabled in the Unity project. By default, only the actions and bindings defined in the active, chosen profile are available to the app.

    When creating an OpenXR interaction feature to define an interaction profile, you can designate specific bindings as "additive". Additive bindings are inserted into the action maps of other enabled profiles during the OpenXR feature initialization and become available to the app. For example, the D-Pad Binding feature makes thumbstick and trackpad bindings available if the active profile doesn't already contain them.

    To enable additve action bindings, your OpenXR interaction feature must:

    • Define an action map with one or more actions marked as isAdditive. (Refer to isAdditive for more information.)
    • Override this AddAdditiveActions() function to add the additive actions to each of the maps in the actionMaps parameter.
    Warning

    It looks like the sample you are looking for does not exist.

    GetDeviceLayoutName()

    Return device layout name string used for register layouts in inputSystem.

    Declaration
    protected virtual string GetDeviceLayoutName()
    Returns
    Type Description
    string

    Device layout string.

    GetInteractionProfileType()

    Return interaction profile type. Default type is XRController. Override this if interactionProfile is not derived from XRController class.

    Declaration
    protected virtual OpenXRInteractionFeature.InteractionProfileType GetInteractionProfileType()
    Returns
    Type Description
    OpenXRInteractionFeature.InteractionProfileType

    Interaction profile type.

    OnEnabledChange()

    Handle enabled state change

    Declaration
    protected override void OnEnabledChange()
    Overrides
    OpenXRFeature.OnEnabledChange()

    OnInstanceCreate(ulong)

    Called after xrCreateInstance. Override this method to validate that any necessary OpenXR extensions were successfully enabled (OpenXRRuntime.IsExtensionEnabled) and that any required system properties are supported. If this method returns false, the feature's enabled property is set to false.

    Declaration
    protected override bool OnInstanceCreate(ulong xrSession)
    Parameters
    Type Name Description
    ulong xrSession
    Returns
    Type Description
    bool

    true if this feature successfully initialized. Otherwise, false.

    Overrides
    OpenXRFeature.OnInstanceCreate(ulong)
    Remarks

    If this feature is a required feature of an enabled feature set, returning false here causes the OpenXRLoader to fail, and XR Plug-in Management will fall back to another loader if enabled.

    See Also
    Enabling OpenXR spec extension strings

    RegisterActionMapsWithRuntime()

    Register action maps for this device with the OpenXR Runtime. Called at runtime before Start.

    Declaration
    protected virtual void RegisterActionMapsWithRuntime()

    RegisterDeviceLayout()

    Register a device layout with the Unity Input System. Called whenever this interaction profile is enabled in the Editor.

    Declaration
    protected virtual void RegisterDeviceLayout()

    UnregisterDeviceLayout()

    Remove a device layout from the Unity Input System. Called whenever this interaction profile is disabled in the Editor.

    Declaration
    protected virtual void UnregisterDeviceLayout()
    In This Article
    Back to top
    Copyright © 2026 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)