Lance Larsen - .NET Architect Madison Wisconsin

A Holonaut’s Guide: HoloLens Step-by-Step Setting up Unity3D + Visual Studio

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!

20160424_220826_HoloLens20160424_220829_HoloLens

Screen Shot 04-24-16 at 08.27 PM

1) Launch your Unity studio, and let’s start a New Project

Screen Shot 04-24-16 at 08.27 PM 001

2) Enter the Project Name and Location for your new project.
3) Make sure you have 3D selected.
4) Then Create Project

Screen Shot 04-24-16 at 08.29 PM 001

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.

Screen Shot 04-24-16 at 08.29 PM 002

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

Screen Shot 04-24-16 at 08.30 PM

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

Screen Shot 04-24-16 at 08.31 PM

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.

Screen Shot 04-24-16 at 08.34 PM 001

12) File > Save Scene ( or Ctrl-S ) – name it “HoloLens”

Screen Shot 04-24-16 at 09.04 PM

13) File > Build & Run – brings up our Build Settings dialog box

Screen Shot 04-24-16 at 09.05 PM 001

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

Screen Shot 04-24-16 at 09.06 PM 001

16) In Build Settings > Windows Store > SDK – change it to Universal 10

Screen Shot 04-24-16 at 09.06 PM 002

17) In Build Settings > Windows Store > UWP Build Type– change it to D3D (Direct3D)

Screen Shot 04-24-16 at 09.06 PM 003

18) In Build Settings > Windows Store > check the Unity C# Projects option

Screen Shot 04-24-16 at 09.06 PM

19) In Build Settings –> click the Player Settings button (bottom left)

Screen Shot 04-24-16 at 09.08 PM

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

Screen Shot 04-24-16 at 09.09 PM 001

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.

Screen Shot 04-24-16 at 09.09 PM 002

24) Check the SpacialPerception option – allowing the HoloLens to detect its surrounding environment.

Screen Shot 04-24-16 at 09.11 PM

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.

Screen Shot 04-24-16 at 09.12 PM

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.

Screen Shot 04-24-16 at 09.13 PM

29) Lets connect to our HoloLens – see my previous article on “HoloLance is Online! Connecting your PC to your HoloLens

Screen Shot 04-24-16 at 09.15 PM

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)

Screen Shot 04-24-16 at 09.17 PM 001

33) Watch it build baby… :)

Screen Shot 04-24-16 at 09.17 PM

34) Unity will launch a Windows Explorer > drill down into App

Screen Shot 04-24-16 at 09.22 PM 002

35) Click your *.sln file ( in this case BubblePop.sln )

Screen Shot 04-24-16 at 09.39 PM 001

36) In Visual Studio > change to Release

Screen Shot 04-24-16 at 09.39 PM 002

37) In Visual Studio > change to x86

Screen Shot 04-24-16 at 09.39 PM 003

38) In Visual Studio > change to Remote Device

Screen Shot 04-24-16 at 09.40 PM

39) As seen previously in (32) enter the IP Address for your HoloLens

Screen Shot 04-24-16 at 09.41 PM

40) In Visual Studio > Build (F5) your project

20160424_220826_HoloLens

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

20160424_220829_HoloLens

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…

 
Comments

No comments yet.

Leave a Reply