Greetings fellow Holonauts! Here are Step-by-Step visual instructions for setting up your Unity 3D application to run on your HoloLens!
Ready to get Holographic! This will be the start of a series of articles on making your first Unity 3D Holographic experience, ie. game :)
As detailed in “A Holonaut’s Guide: HoloLens Development Resources” – check out “Download HoloLens Developer Tools” – once you have those installed you’re ready to go!
Also check out the newly launched HoloSoft.Net for the latest HoloLens / AR / VR news!
1) Launch your Unity studio, and let’s start a New Project
2) Enter the Project Name and Location for your new project.
3) Make sure you have 3D selected.
4) Then Create Project
5) When the Unity project launches, select Main Camera in the Hierarchy section (far left).
6) Note that the Inspector section (far right) will show the details of our camera.
7) As the HoloLens is the center of our Universe, we need to change the Inspector > Transform > Position to X: 0 Y: 0 Z: 0
8) When using a HoloLens we want to see the real-world, so we need to make the background transparent.
9) We do so by selecting Camera > Clear Flags and setting it to Solid Color
10) The Solid Color that we need is black, so make sure Hex Color is 00000000 (just drag the color selector to the bottom-right)
11) IMPORTANT – if not set all the way to 00000000 – this will cause your deployed Unity app on the HoloLens to be show in 2D.
12) File > Save Scene ( or Ctrl-S ) – name it “HoloLens”
13) File > Build & Run – brings up our Build Settings dialog box
14) In Build Settings > Platforms > select Windows Store and then click Switch Platform
15) IMPORTANT – If you don’t have Windows Store as an option then you need to go back and install the UWP Runtime for Unity – see http://unity3d.com/pages/windows/hololens#download
16) In Build Settings > Windows Store > SDK – change it to Universal 10
17) In Build Settings > Windows Store > UWP Build Type– change it to D3D (Direct3D)
18) In Build Settings > Windows Store > check the Unity C# Projects option
19) In Build Settings –> click the Player Settings button (bottom left)
20) In the Inspector section (far right) > scroll down to you see Other Settings section.
21) IMPORTANT – Check the Virtual Reality Supported option. If you don’t then when you deploy to the HoloLens the application will be launched in 2D not 3D
22) In the Inspector section (far right) > expand Publishing Settings > scroll down to Capabilities section.
23) Scroll down with the Capabilities scroll bar and check the Microphone option – will allow us to use voice commands.
24) Check the SpacialPerception option – allowing the HoloLens to detect its surrounding environment.
25) In order for us to see something when we deploy to our HoloLens, let us add a sphere.
26) In the Hierarchy section (far left) > click Create dropdown > 3D Objects > Sphere.
27) As we can see, the sphere appears right on top of our camera, change the Inspector > Transform > Position to X: 0 Y: 0 Z: 2 – where Z is the distance away from us as seen by the blue arrow.
28) Also, lets make the sphere smaller, change the Inspector > Transform > Scale to X: 0.2 Y: 0.2 Z: 0.2.
29) Lets connect to our HoloLens – see my previous article on “HoloLance is Online! Connecting your PC to your HoloLens”
30) Save your project – File > Save Scene ( or Ctrl-S )
31) Once again, File > Build & Run – brings up our Build Settings dialog box. Click Build.
32) You will be prompted to create a C# build folder – Build Windows Store dialog > New Folder > name it App (this could be anything btw)
33) Watch it build baby… :)
34) Unity will launch a Windows Explorer > drill down into App
35) Click your *.sln file ( in this case BubblePop.sln )
36) In Visual Studio > change to Release
37) In Visual Studio > change to x86
38) In Visual Studio > change to Remote Device
39) As seen previously in (32) enter the IP Address for your HoloLens
40) In Visual Studio > Build (F5) your project
41) If all deploys as expected (which sometimes takes a restart of either the HoloLens or Visual Studio) – you’ll see Made with Unity appear
42) Then your first Hologram from Unity appears!!! Walk around it – it’s truly amazing.
Well done Holonaut! We’re on our way to making some fantastic experience…