com.unity.xr.interaction.toolkit 3.0.0-pre.2
com.unity.xr.interaction.toolkit
Source docsNotes: processedReleased February 29, 2024
Unity Compatibility
Minimum Unity: 2021.3
Package Dependencies
- com.unity.inputsystem (1.7.0)
- com.unity.mathematics (1.2.6)
- com.unity.modules.audio (1.0.0)
- com.unity.modules.imgui (1.0.0)
- com.unity.modules.physics (1.0.0)
- com.unity.modules.xr (1.0.0)
- com.unity.ugui (1.0.0)
- com.unity.xr.core-utils (2.2.3)
✨ Features
- Added the `NearFarInteractor` component, a versatile new interactor enabling both near and far interactions. It's designed to be more modular and delegate out responsibilities that used to be difficult to customize within classes like `XRDirectInteractor` and `XRRayInteractor`. It uses two distinct casters (`IInteractionCaster`) to find valid interaction targets, with the near caster optimized for close-range interactions and the far caster supporting UI interaction and distance-based sorting. The interactor also integrates UI interaction capabilities, snapping modes for interactable objects, and implements various interfaces for advanced XR interactions.
- Added the `CurveInteractionCaster` component, a ray casting implementation to be used with `NearFarInteractor` as the Far Caster. It specializes in curved ray casting, offering advanced world-space UI interactions with flexible path creation. The class implements the `ICurveInteractionCaster` interface, supporting varied hit detection methods including sphere and cone casting, in addition to standard ray casting. Key features include customizable casting distances, curve segments, and casting radius. It is intended to fill the equivalent role of the casting performed by the `XRRayInteractor` component.
- Added the `SphereInteractionCaster` component, a sphere casting implementation to be used with `NearFarInteractor` as the Near Caster. It executes a sphere overlap check to identify valid interaction targets. It's designed for scenarios where a spherical area of detection is preferable over a single point or line. The class features adjustable parameters like the radius of the sphere cast, physics layer mask for target filtering, and the option to include or ignore trigger colliders. It is intended to fill the equivalent role of the casting performed by the `XRDirectInteractor` component.
- Added the `CurveVisualController` to manage the visual representation of a line, typically used for highlighting interaction paths or trajectories. It features customizable width, color gradients, and dynamic behaviors like retraction or expansion. The class supports dynamic line rendering with adjustable properties such as line width, gradient, and extension rate. It also offers different line dynamics modes (like traditional, retract on hit loss, and expand from hit point) and the ability to snap to specific points or volumes. It is intended to fill the equivalent role of controlling ray visuals in the `XRInteractorLineVisual` component.
- Added the `InteractionAttachController` component. It is intended to be a simple template showing how to control the interaction attach transform used by the `NearFarInteractor`. It can handle stabilization when an offset is present and handle an amplified offset movement to move distant objects closer with ease using a pulling gesture.
- Added the `farAttachMode` property in the `XRGrabInteractable`. It allows for overriding how the `NearFarInteractor` (when far selecting) and the `XRRayInteractor` adjusts their attach transform to cause the interactable to snap near to the hand or whether it moves to the far hit point.
- Added public [`RequestTeleport`](xref:UnityEngine.XR.Interaction.Toolkit.TeleportationAnchor.RequestTeleport) method to [`TeleportationAnchor`](xref:UnityEngine.XR.Interaction.Toolkit.TeleportationAnchor) to allow a teleport to the anchor to be triggered manually, such as from a UI button click event, instead of only from interaction events like select exited. Teleport to anchor can also be triggered from the Inspector window in the More (⋮) menu during Play mode for debugging.
- - Added protected [`SendTeleportRequest(IXRInteractor)`](xref:UnityEngine.XR.Interaction.Toolkit.BaseTeleportationInteractable.SendTeleportRequest\(UnityEngine.XR.Interaction.Toolkit.IXRInteractor\)) to the base abstract class to allow the teleport to be triggered from additional contexts.
- Added option in [`ARTransformer`](xref:UnityEngine.XR.Interaction.Toolkit.Transformers.ARTransformer) to filter translatable planes by the AR Foundation plane classifications. Uses either a list of `PlaneClassification` enum (for older than ARF 6.0) or `PlaneClassifications` flags enum (ARF 6.0 and newer) types.
- Added `ARTransformerEditor` to customize the Inspector window of the AR Transformer component.
- Added warnings to the Inspector window of input button reader properties (`XRInputButtonReader`) when the performed Input Action is not configured correctly for button-like behavior.
📈 Improvements
- Changed `LogicalInputState` by renaming `wasUnperformedThisFrame` to `wasCompletedThisFrame` to match terminology in Input System.
- Improved input-related backwards compatibility of interactors that have not yet migrated to the new input reader architecture by replacing the Force Deprecated Input property in the Inspector window with Input Compatibility Mode. This property defaults to `Automatic`, which will search up the hierarchy for XR Controller components and only use the deprecated XR Controller component for input if found. This property can also be set to `ForceDeprecatedInput` or `ForceInputReaders` depending on the desired behavior.
- - Added `XRBaseInputInteractor.inputCompatibilityMode` serialized property and `XRBaseInputInteractor.InputCompatibilityMode` enum.
- - Deprecated and removed serialization of `XRBaseInputInteractor.forceDeprecatedInput` property.
- Changed Hand Menu component to automatically hide the menu when a selection is made with the hand for which the menu is anchored to. This functionality can be reverted by disabling the new Hide Menu On Select property.
- Changed the default value of Force Grab on the XR Ray Interactor component from enabled to disabled.
- Changed Starter Assets sample script `ControllerInputActionManager` to support Near-Far Interactor, not just Ray Interactor, for the distant/ray manipulation interactor.
- Changed Hands Interaction Demo sample script `HideObjectWhenRayInteractorBlocked` by renaming to `HideObjectWhenInteractorBlocked` and updated to work with `XRBaseInteractor` instead of just `XRRayInteractor`.
- Changed `XRBaseGrabTransformer` by making `Start` and `OnDestroy` methods `virtual`.
- Moved interactor components from the **Component** > **XR** menu into the **Component** > **XR** > **Interactors** menu.
🔧 Bug Fixes
- Fixed `XRPokeInteractor` and `TrackedGraphicRaycaster` to ensure poke interactor data is cleared when the UI element with a poke interaction is disabled. (XRIT-115)
- Fixed an issue where target filters could not influence the prioritized poke interactable. (XRIT-114)
- Fixed an issue in `XRUIInputModule` where display index was not being set for mouse or touch in the `PointerEventData` object causing it to always default to the first display. (XRIT-125)
- Fixed use of renamed Rigidbody properties in Unity 2023.3 to avoid script migration prompt.
- Fixed a small performance issue at startup by making XR Ray Interactor only search for AR Raycast Manager when both AR Foundation is installed and Enable AR Raycasting is enabled.
- Fixed an issue with two handed rotations using the XRGeneralGrabTransformer where some inconsistent motion would occur when the user would rotate more than 180 degrees in any axis.
- Fixed compilation errors on tvOS platform where `ENABLE_VR` is not defined.
- Fixed a bug in `XRSocketInteractor` that prevented the deselecting of the Starting Selected Interactable when Hover Socket Snapping was enabled.
- Fixed broken markdown links within tables in samples documentation in the manual.
- Fixed mistakes in changelog with version 3.0.0-pre.1 where some entries in the section for version 2.5.2 were missing or should have been in the section for version 3.0.0-pre.1.
