The Mixed Reality Forums here are no longer being used or maintained.
There are a few other places we would like to direct you to for support, both from Microsoft and from the community.
The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.
For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.
If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.
And always feel free to hit us up on Twitter @MxdRealityDev.
Is it safe to have Camera children in Unity?
Hello everybody.
I'm implementing a basic cursor that I simply attached as a child game object of the main camera. Before I carry on I wanted to know whether it's safe to create any child game objects underneath the main camera in Unity? Or is it a shallow concept that gets replaced with some "actual" camera at runtime thus neglecting everything underneath?
Thank a lot!
Building the future of holographic navigation. We're hiring.
Best Answers
-
OptionsHoloSheep mod
Hi @stepan_stulov yes it is safe to put children under the main camera gameobject and is one technical way to achieve UI elements that follow you. For example Brandon from Unity presented something similar during our user group meeting this week: https://www.youtube.com/watch?v=12ff6eJP9Qk
(see the Object Finder demo around the 49 min mark)However it is also worth noting that Microsoft has done a lot of research on user experience issues where UI elements move fixed to the users view and the general guidance is that in most cases you should not fix UI to the view in this way and should use techniques like the TagAlong functionality found in the HTK.
Further discussion on the topic can be found in threads like Fixed object in the cameral/view
Windows Holographic User Group Redmond
WinHUGR.org - - - - - - - - - - - - - - - - - - @WinHUGR
WinHUGR YouTube Channel -- live streamed meetings1 -
Optionsstepan_stulov ✭✭✭
Ok, in my previous message I didn't fully resolve the mystery. Now I did! Here is the deal. I've made a test scene where I placed some spheres very close to camera's near clipping plane in front if it. I've placed 5 test spheres so that they're at -1.0, -0.5, 0.0, 0.5, 1.0 vertical positions of the viewport. Bet how many spheres I've eventually seen when running on HoloLens? Nope, not even 3. Just 1 in the middle. Now that I ran this test it seems stupidly obvious that HoloLens drives camera's FOV and other settings. But before that I naturally wondered where the hell my sphere was. The solution to the floating gaze viewport point is not to rely on camera's initial FOV but to specify it in percentege/fraction and then mathematically calculate the gaze ray based on camera's runtime values.
Hope this helps anyone with the similar problem.
Building the future of holographic navigation. We're hiring.
6
Answers
Hi @stepan_stulov yes it is safe to put children under the main camera gameobject and is one technical way to achieve UI elements that follow you. For example Brandon from Unity presented something similar during our user group meeting this week: https://www.youtube.com/watch?v=12ff6eJP9Qk
(see the Object Finder demo around the 49 min mark)
However it is also worth noting that Microsoft has done a lot of research on user experience issues where UI elements move fixed to the users view and the general guidance is that in most cases you should not fix UI to the view in this way and should use techniques like the TagAlong functionality found in the HTK.
Further discussion on the topic can be found in threads like Fixed object in the cameral/view
Windows Holographic User Group Redmond
WinHUGR.org - - - - - - - - - - - - - - - - - - @WinHUGR
WinHUGR YouTube Channel -- live streamed meetings
Hi, HoloSheep. Fantastic answer, thank you. I only wanted to attach the cursor in a form of a little sphere for testing purposes. I am aware of Microsoft's user experience recommendation of avoiding hard-attached thing to your head. In my case I was experimenting with placing holograms over their reality counterparts using intersection with the floor. It appeared that if I use the "conventional" gaze from the centre of the viewport I don't see the object in front of me in full as it's clipped by the viewport. I ended up simply using a cursor that's one third or fourth from the bottom of the viewport thus allowing better overview further ahead. And at some point HoloLens stopped showing my little test sphere altogether. But with your answer I now know the problem is somewhere else. Thank you!
Building the future of holographic navigation. We're hiring.
@HoloSheep Thanks for the answer. I tried the fixed UI, and I feel it is a little hard to keep my eyes focus on both physical and virtual world. I believe that TagAlong is the way to go.
I resolved the mystery of my test sphere as child of camera not showing up. I accidentally set camera's depth from -1 to 0. Apparently that disabled rendering or something. Who could have thought.
Building the future of holographic navigation. We're hiring.
Ok, in my previous message I didn't fully resolve the mystery. Now I did! Here is the deal. I've made a test scene where I placed some spheres very close to camera's near clipping plane in front if it. I've placed 5 test spheres so that they're at -1.0, -0.5, 0.0, 0.5, 1.0 vertical positions of the viewport. Bet how many spheres I've eventually seen when running on HoloLens? Nope, not even 3. Just 1 in the middle. Now that I ran this test it seems stupidly obvious that HoloLens drives camera's FOV and other settings. But before that I naturally wondered where the hell my sphere was. The solution to the floating gaze viewport point is not to rely on camera's initial FOV but to specify it in percentege/fraction and then mathematically calculate the gaze ray based on camera's runtime values.
Hope this helps anyone with the similar problem.
Building the future of holographic navigation. We're hiring.