How to Build Applications using ZED and Unity on Linux
We’re introducing the ZED Unity wrapper for Linux. Learn how you can use it to build new or existing apps for Ubuntu.
In this tutorial, we will show how easy it is to build an application for Linux when you are running the Unity editor on Windows.
We won’t cover how to create the scenes here; other than the final Build process, it’s the exact same as Windows and is covered in our Unity documentation.
- Unity 2018.1 or higher
- ZED Unity Plugin from GitHub with the new Linux compatibility
- ZED SDK (for development only; app will not require it)
Installing Linux Build Support on Windows
Each of Unity’s build targets (Android, PS4, etc.) do not come installed with the editor by default. You choose which platforms to add support for during the initial installation process. If you added Linux support when you first installed your current Unity version, you can skip this section.
- Open Unity Hub
- Go to the Installs tab at the top and click the … icon beside your preferred Unity version
- In the new list that appears, check Linux Build Support and click done to begin the installation. (If it’s already checked, you have it installed)
- Wait for the installation to complete and restart Unity Hub
Import the Plugin
- Download the files from the ZED Unity plugin on GitHub
- Copy the ZEDCamera/Assets/ZED folder from the download into the Assets folder in your new project. †
- Open a scene you would like to build. You can use the scenes in the Examples folder, like Simple MR, Planetarium or Dark Room
† If working on an existing project, it is cleanest to do this into an empty Unity project, then use Assets -> Export Package to make a fresh package of these files that you can import into your main project with Assets -> Import Package.
Build the Application
- On the Menu bar, click File -> Build Settings (or hit Ctrl+Shift+B) to go to the Build menu
- In the Target Platform dropdown in the middle-right, drag and drop from Windows to Linux. If Linux is not an option, make sure you followed the instructions in the Installing Linux Build Support on Windows section all the way
- Click Build
The application will be called [appname].x86_64, with a [appname]_data folder attacked. Inside the [appname]_data/plugins folder, you’ll see the libsl_unitywrapper.so directly inside.
Copy that file and folder onto your Linux desktop. To run it, you may need to set this file as an executable. Do so with this command:
$ chmod +x ./XXXXX.x86_64
Launch the application, and enjoy running it on Linux!