Unity 3D GameObjects not visible in HoloLens2, MRTK - unity3d

I followed this tutorial https://learn.microsoft.com/en-us/training/modules/learn-mrtk-tutorials/1-1-introduction and did every step. But when I run it on the HoloLens, I don't see anything.
Build configurations are as in the tutorial, HoloLens2 is in Developer mode and has been paired before. Tools are as in https://learn.microsoft.com/de-de/windows/mixed-reality/develop/install-the-tools?tabs=unity
I am building the app over WIFI.
When the app starts on HoloLens, mesh appears for a moment and I get a question asking if it is allowed to use on my microphone.
"Build with Unity" or similar does not appear, and no objects either. I see "nothing".
What could be the problem?
I use:
Unity 2021.1.20f
MRTK v1.0.2206. Preview (from Microsoft Download Center)

It was actually the wrong Unity version.
I am now using Unity 2020.3.4 and I can see and move the objects.

Related

Mismatch of stereoscopic rendered images on HoloLens2

I am using Unity 2019.3.15f1 with the MRTK 2.4.0 for developing an augmented reality app on the HoloLens 2. Unfortunately, the stereoscopic rendering is not working correctly. There is a mismatch between the images rendered for the right and the left eye. You see two images of the scene, running the app on the HoloLens. It doesn`t matter if I am using the Remote Player or ruining a builded app on the HoloLens. In both cases there are two not matching rendered images for both eyes. The HoloLens is calibrated. Other Apps from the microsoft store, or the "Homemenu" at the HoloLens have no mismatch of the images. But if I am running MRTK-example scenes on my HoloLens 2 there is also a dismatch between the rendered images for both eyes.
Does anyone had troubles with the same issue and can provide some ideas about a solution how the images can be matched correctly for both eyes?
It seems like something went wrong in your Unity project setting, it is recommended to double-check the XR Setting to troubleshoot. For XR SDK, please follow this link: Getting started with MRTK and XR SDK. For Legacy XR, have a look at Legacy XR
Besides, we always recommend the latest Unity LTS (Long Term Support) and MRTK as the best version so that we can avoid some known issue, and the current recommendation is to use Unity 2019.4.20f1 and Mixed Reality Toolkit v2.5.4.

Hololens 1 does not detect air tap or other gestures in MRTK scene

I am currently working on developing an application for the Hololens 1 using Unity and MRTK.
I have been unable to get the air tap or any other input working in my application. The ring pointer for airtap does not appear in the application even though it works in the Unity Play Mode Input Simulation and other applications on the device. I tried it with the MRTK examples and even those did not work on the device.
Also I had to add the Tracked Pose Driver from the Player Settings to get the camera working properly but have not figured out how to get the application to accept gesture input.
Also tried the solution listed here: Why is 'air tap' gesture not working on HoloLens1 in my Unity/MRTK app?
but that did not work.
Will appreciate any guidance to solve this problem.
I finally got my project working after a lot of trying.
It turned out that initially, I had unknowingly configured the project to use XR SDK in Unity 2019 and thus had to configure MRTK accordingly. Thank you to Kevleigh for helping me with the issue here: https://github.com/microsoft/MixedRealityToolkit-Unity/issues/7850
While this did work for my example project, I couldn't get the main project to work with the same settings even after installing all the plugins.
Finally, I had to switch to Unity 2018 and I got the project working with MRTK 2.3 and the default configuration. So, while Unity 2019 did not work for me you can get it working with XR SDK as suggested in the above link.

Hololens Unity app always deploys in 2D instead of 3D

I'm developing an app for the Hololens 1 in Unity, and it runs perfectly fine on the device when using Holographic Remote. However whenever I build and deploy the application through Visual Studio, it then only launches in 2D mode on the Hololens (as a flat "window" you can position in space). What settings control this behaviour?
Unity version is 2019.1.4f1,
Visual Studio is 2017 Community Edition,
I'm on Windows 10.
Developer mode is turned on on both the HL and my desktop. Virtual Reality Support is ticked in Unity, the Mixed Reality SDK is added to the list and the Build settings are on x86 / D3D Project.
I tried replacing my scene with one of the examples from the MRTK, but to no avail. Strangely enough, if I make a clean new project with nothing except the MRTK example in it it does deploy properly, so there must be something in my project interfering. I just can't figure out what.
Expected behaviour is that the application launches in "room scale" mode, i.e. all other applications disappear and the objects in my scene can be viewed in 3D.
EDIT: This has been marked as a possible duplicate. The answers given there do not solve my problem, however. I already made sure that "Virtual Reality Supported" is ticked in the XR settings and the SDK is added to the list. I don't think I have a Windows Insider preview, but since I was able to deploy perfectly fine with a fresh project I don't think that's really the problem...
It appears Vuforia was causing the issues. I got it to deploy in 3D with 'Vuforia Augmented Reality Supported' ticked and the following settings in VuforiaConfiguration:
Camera Device Mode: MODE_OPTIMIZED_SPEED
Device Type: Digital Eyewear
Device Config: Hololens
Video Background DISABLED
Device Tracker DISABLED
Furthermore, 'Vuforia' must not be added to the list of Virtual Reality SDKs in XR Settings.
Note that I have not tried all subsets of these settings individually, some of them might not have an impact whatsoever (except for the last one, I am quite certain adding that SDK will force the app into 2D mode).
Also note that I haven't verified that Vuforia actually works correctly on the Hololens, just that I can deploy the app in 3D mode with it enabled, given the above settings. If someone could confirm that Vuforia is even supported by MRTK v2?
EDIT: apparently the problem is also caused by ticking "WSA Holographic Remoting Supported" in the XR Settings, so be sure to disable that.

Unity crashing with DirectX on new computer

I have recently purchased a new computer :
https://pcandparts.com/hp-gaming-laptop-power-15-cb005ne-acid-green/
And I have installed Unity on it. The problem is that every time I try to move the layouts unity screen becomes black and freezes.
https://gyazo.com/fdbbba09cbee7005b1b55637cea19855
After trying to search online, post on multiple forums, contacting Unity Team and Nvidia support I have found that the only solution is running unity from the command using -force-glcore
In fact, Nvidia support have been unable to find the solution and Unity Team was stressing that I update my graphic drivers and Directx version however both of them are latest versions and so is Windows 10.
https://gyazo.com/ee810b7d18be7580d3703e42c7b46526
https://gyazo.com/ea751dcf39ebfc791f2dce59cd219a0c
https://gyazo.com/d43718cc693a7c9cac44f4924bf968da
This is the latest email I have received from Unity Team :
https://gyazo.com/df2d7e960484cd8c682e5b733860e935
as well as the link for unity forum that also includes the error and editor logs:
https://answers.unity.com/questions/1511848/unity-editor-crash-2.html?childToView=1512288#comment-1512288
I also tried multiple versions of Unity from 2017 and 2018.
I will provide any additional information needed.
How can I solve the problem so I can run Unity smoothly and without having to go to force-glcore ? And what is truly happening?
Thank you in advance for taking the time to read
How can I solve the problem so I can run Unity smoothly and without
having to go to force-glcore ?
There are other things you can try.
1.Use DirectX9 instead of DirectX11. The default on the new Unity verions is DirectX11.
Go to File ---> Build Settings... ---> Player Settings ---> Other Settings then un-check the Auto Graphics API for Windows API checkbox. From there drag and move Direct3D9 above Direct3D11 click Apply and restart the Unity Editor.
If Direct3D9 is already above Direct3D11 then move Direct3D11 above Direct3D9.
2.If #1 doesn't work, try other graphics API. You can try other 3 graphics API such as Direct3D9, Vulkan and OpenGL Core.
These are hidden and you must click the + sign then manually add them to the menu then drag them to the top.
Then you can chose which one to add and then drag them to the top to force Unity use them.
Once of these should work for you. Chose the one that works the most. You don't need -force-glcore when opening Unity to use this. Your issue is mostly a driver issue sometimes, a workaround like this solves it until the driver is fixed.

Unity3d 5.5 Enable Vr for Cardboard

I'm almost new to Unity3D, I've watched this presentation of Unity evengelist made in February 2016:
https://www.youtube.com/watch?v=pK0ZD53gOoE
Evengelist said and showed that to bring project to VR you need to select one checkbox (Virtual Reality Supported). Now in 5.5 version just downloaded, when I select Virtual Reality Supported it says also "you must add at least one VR SDK", also after that checkbox selected when I click play scene, I do not see two eyes screen, just ordinary view. When last year I tried to make VR for Cardboard and loaded Cardboard SDK, scene view showed two screens to each eye in play mode.
So the question - how now make VR that works on Cardboard in Unity3d? Do I still need Cardboard SDK (I don't need magnet input support or similar, just stereo and head movement support)?
Added: I don't have Cardboard SDK option in Unity somehow:
According to Unity Blog, Cardboard support is exclusive to Android only. iOS Cardboard support will be added soon.
Do I still need Cardboard SDK
I don't think you need the SDK. This is now Native support for Cardboard. Although,you can still download the Cardboard SDK and Unity will automatically use it.
And here is how to enable Cardboard SDK in Unity 5.5.
Thanks Programmer for your answer, it helped me find what my issue was. However, I've spent literally all of my time over the past few days trying to get Google Cardboard and Unity setup, so I figured I can at least post my answer too.
One problem I initially ran into was that I was trying to use GVR Unity SDK v1.1. There are several bugs in this version, so I reverted back to the GVR Unity SDK v1.0.3. This can be downloaded from the github repo: https://codeload.github.com/googlevr/gvr-unity-sdk/zip/f391c2436426857899af1c37f0720b3985631eb3
Then, I ran into multiple problems just getting things to run on android, so I found that I have to use build tools version 24.0.1. This can be downloaded using the Android SDK Manager executable.
Lastly, the "cardboard" option wasn't appearing for me as part of the drop downs, just like in the picture posted by the asker. The problem was that I was using a regular version of Unity, when I needed to actually be using the technical preview. This can be downloaded from https://unity3d.com/partners/google/daydream, and I'm running Unity v5.4.2f2-GVR13.
Then the drop down "cardboard" appeared, and I was able to follow google's official instructions (https://developers.google.com/vr/unity/get-started) and get things set up.
I ended up installing the Unity 5.6 Beta and got my Cardboard app built quite simply using the EasyMovieTexture store asset, turning on VR in Player Settings and adding Google Cardboard. It is working great in IOS and Android. I am working on turning off the Google Overlay as my app toggles between Cardboard and a simple 360 view and that is a proving a challenge. It seems from what I have read Google does not want you to turn off their overlay. I might try to do this natively on IOS.