About XR Core Utilities
The XR Core Utilities package contains a variety of classes and extension methods which are commonly used and shared between multiple XR packages. Some particularly useful utilities include:
- Geometry Utilities
- Point of closest approach
- Closest edge of a polygon
- Check if point inside of polygon
- Compute 2D convex hull
- Collection pool
- Object pool
- Math Utilities
- Optimized approximately equal functions
- Clamp
- Axis aligned check
- Shortest angle distance
- Bounds extensions
- Contains completely
- Quaternion extensions
- Constrain yaw
- Editor GUI
- Flags Property Drawer
- Scriptable Settings (serialized project settings)
- XROrigin
- Project validation
Refer to the Script Reference for a complete list of utility classes.
Install XR Core Utilities
The XR Core Utilities package is automatically installed when you add other packages to your project that depend on it, such as AR Foundation or the XR Interaction Toolkit.
To install this package separately:
- Open the project that you plan to use.
Click the following link: com.unity.xr.core-utils.
The Unity Package Manager window opens with the package name entered in the Add package by name dialog.
(Optional) Enter the version number to install. If left blank, Unity chooses the "best" version -- typically the latest, release version for the current Unity Editor.
- Click Add.
Note
Computer configuration issues can prevent package links from opening directly in the Unity Editor. If this happens, follow the instructions in Adding a registry package by name, using the package name: com.unity.xr.core-utils
.
For an overview of installing and managing packages in Unity, see The Package Manager tutorial.
For a detailed description of how to use the Package Manager, see the Package Manager in the Unity Manual.
Use XR Core Utilities
This contains entirely C# code. Refer to the API documentation for details.
Troubleshoot the Input System
There is an issue with missing dependencies in version 1.0.2 of com.unity.inputsystem
. This issue appears in versions 2019.4, 2020.3 and 2021.1 of the Unity Editor. Upgrading to version 1.1.1 of the input system package fixes these missing dependencies.
Technical details
Requirements
This version of the XR Core Utilities package is compatible with the following versions of the Unity Editor:
- 2019.4+