Comment on page
🔌
Unity
(Updated March 25, 2022, v1.5.0)
The Looking Glass Unity Plugin helps you build 3D experiences for your Looking Glass. If you're just getting started, please consult this setup tutorial guide.
Note that our Unity Plugin currently does not support URP or HDRP.
- (Windows) Having the taskbar show on your Looking Glass device will offset the center of the 3D scene - it is recommended that you hide your taskbar on the Looking Glass.
- (MacOS) Builds of your project need to be launched via the terminal the first time they run on MacOS Monterey or newer.
- (MacOS) The editor preview window looks incorrect when showing for the first time after restarting Unity. Toggling the preview with
Cmd + E
should fix the issue. - (Linux) The editor preview window may use an incorrect position in certain OS display arrangements.
- In some versions of Unity after (but not including) 2018.4, a NullReferenceException is logged in the Unity console when leaving playmode when you have the preview window open.
- A Unity camera rendering to the same display target as a Holoplay capture will have its entire render overwritten if its depth value comes before (is less than) the Holoplay capture's depth value.
- The Holoplay capture renders black on the first frame of playmode.
- Closing HoloPlay Service after your Unity project is open with the HoloPlay Unity Plugin may freeze or crash Unity.
The best way to learn about all of the Plugin's features is to consult the example scenes. The eight example scenes cover the following functionality:
- Displaying 3D Unity content in the Looking Glass
- Placing text within the Looking Glass, and how it blurs when moved from the primary focal plane
- The importance of post-processing in creating a pleasant visual scene and in blurring artifacts
- Working with the 3D cursor
- Using buttons on non-Portrait Looking Glass devices
- Rendering to multiple connected Looking Glasses (Unity 2018 and 2019 only)
- Multi-monitor application implementation
- Recording content from the Unity editor or a build
Beginning with version 1.3.0 of the Unity plugin, we have supported Linux!
However, due to some complications around Unity's window management system, when running builds on Linux it's necessary to launch them from the command line with the "-adapter" parameter set to the index of your Looking Glass display, as in the following example:
YourApp.x86_64 -adapter 2
The above sets your app to run on your second display, which, typically, is the index of your Looking Glass.
Additionally, in version 1.4.0 of the plugin, there is no support for video recording with Linux. There is a missing dependency to enable this, FFmpeg, which we are aiming to include for Linux users in the future.
The ideal setup for Mac builds currently requires some user setup. We will be working to automate this process in an upcoming release.
In Unity 2018, it is recommended to enable the resolution dialog window, drag the window onto your Looking Glass device, and press Enter or Return.
In Unity 2019, the build will automatically launch on your Looking Glass device. To prevent possible errors, it is recommended to only have the Looking Glass device plugged into your setup and one other monitor.
By default, your main monitor won't be available when you run a build - to get around this, you should set your Mission Control preferences to have "Displays have separate Spaces" toggled on. Once this is set, create another display in Mission Control. Then, you can drag the Unity build onto your Dock, right click, and under "Options" you'll see that you can set it to "Desktop on Display 2".
Alternately, you can launch your app the first time using terminal with the following command:
open -a [appname] --args -monitor 2
and it will, when you open it in the future, target the same display. This example assumes the Looking Glass device is your second monitor - if not, use whichever monitor number matches your Looking Glass device.Note: on MacOS Monterey, you can no longer use the Mission Control setup to launch the build on the Looking Glass and you must use the terminal to launch the app the first time it is run.
In Unity, it's typical for plugins to come with prefabs to accelerate development. The HoloPlay Unity Plugin follows this model and offers a handful of prefabs in Assets/Holoplay/Prefabs. To understand how these work, consult the prefab docs.
More advanced developers may want to know more about how the scripts work. The following pages document the public fields and functions of all the important scripts in the Plugin.
Lastly, if you'd like to develop on the Looking Glass with a Leap Motion, you can consult our Leap Motion integration guide.
Building experiences for the Looking Glass can be challenging because it's such a new medium. To make sure your demos really pop, take a look at our Design Guidelines.
If you're having issues with our Unity Plugin please email us at [email protected] and fill out our bug reporting form.
Last modified 1mo ago