I have been working with Cardboard SDK Package to create VR experiencies and I have been using UI - Screen Space Overlay Canvas for creating buttons in order to disable VR-Mode, go back to main menu, and set up different options, but with the new Unity 5.6 version the UI seems to dissapear under the stereo split cardboard image. Using the Cardboard SDK Package I could set my UI elements over the split screen, but with the new native way the UI Screen Space Overlay is hidden. In spite of this, for example if I have a UI button and touch where it is, it works, but is hidden.
I donât know if anyone else has the same issue or has find another way for doing this.
With native integration, there is no support for screen space overlays. This is standard across all VR devices in Unity in general. Youâll need to move your UI to World Space to get it to appear in VR.
Is there anyway to show cardboard VR as monoscopic, and later, when user presses at cardboard button - change into stereoscopic ? I donât want user to directly get into VR as landing page downloads content, so until the download is finished it will remain monoscopic and after the download is complete it will change to stereoscopic. I am building with Unity 5.6.0f3 with google cardboard sdk 1.4.
With native google vr integration use VRSettings.enabled and set it to false
Use the InputTracker(dunno the right name out of mind) for getting the rotation from the sdk if you still want to keep on using the head tracking
Apply it to the camera
This is called âmagic window modeâ somewhere in the unity documentation
It used to work nicely. Start app in screen space UI, chose stereo or mono and away you go.
Now I cannot figure it out. So Iâve ditched the UI. I can toggle VR off in script so it starts in mono but when I toggle it back to VR it doesnât render the cameras. If I start in VR and toggle to mono and back it is fine.
Iâm trying to do the same thing, switching between âMagic Windowâ and âCardboardâ. I wish there was a âMagic Windowâ Device instead of the weird âLoad Cardboard but set VR to falseâ way of doing things. You need to wait frames between switching aswell for it to work. (co-routines)
Sad that we canât render on top of VR anymore but I understand why. To me itâs more of a problem that the native settings and close button canât be âskinnedâ and most anoying in 5.6.0f3 is that the close button always closes the app.
How is it possible to make a screen fade in/out effect then? I have a game in development where the player can teleport to some specific location using reticle pointer, having a fade in/out effect during teleportation makes the experience much more smooth!
Except for Google VR: they have screen-space overlays of an X/Back button and a Settings button on the edges of the screen.
We would like to add our own, 3rd button in the lower left that enables the user to toggle VR mode on and off.
What workaround does Google VR use? How do we use that same workaround?
First, thank you for replying! I really appreciate every bit of time and help.
Secondly, Iâm confused here, and maybe not communicating well, so let me start over with more detail:
When enabling the âcardboardâ device in Unityâs native VR integration, a screen UI overlay appears on both iPhone and Android devices (screenshot of me pressing the âbackâ button on iPhone below:)
This is a barebones project with no external SDKs added.
So their native integration is somehow drawing this UI overlay, and unlike Android, iOS doesnât permit any apps to draw widgets over the top of others. Iâm not really sure how they do this, as thereâs no published code, or documentation for this anywhere.
Prior to their native integration with Unity, the Google Cardboard Unity plugins did this same UI overlay thing.
If Unity isnât involved in rendering this UI overlay, it must be possible for an iOS Unity plugin to render things on the screen outside of Unityâs involvement? If so, how might we go about doing the same?
Any further help you can provide is much appreciated, Iâm at a loss here!
I can not really speak to what was happening before. What I can tell you now is that that view is created by Google through their library. We have no responsibility for any of the UI widgets they overlay (Back/X button, settings button, eye divider line).
For either platform you could try to manually walk/inspect the view hierarchy and try to inject your own UI items but I can foresee a number of issues, primary of which is an inability to get into the Google VR Play store with that.
Thanks for the help, joejo â that UI injection approach sounds pretty fragile, and we will investigate other routes, but good to know its possible.
Do you happen to know at what point would we do that UI injection? (e.g. At any point after enabling VR? Or in OnGUI?)
Lastly, are there technical reasons (performance, undefined behavior, etc.) that Unity disables the Screen Space - Overlay canvases or is it purely because its generally a terrible, user-headache-inducing practice for most VR scenarios?
Thank you again, Iâll stop with the deluge of questions =)
I believe the technical issue has to do with reprojection. Even though we may have the screen overlay locked, the device itself will reproject the display as needed and so the âlockedâ screen overlay will have a tendency to drift around.
Will this be fixed. This locked cardboard UI is not a very professional approach, as companies like to control their user experience, and as long as it is close/the same as the default one why would that be a problem?
The X at the left top sends an Escape key event. On that event you can disable VRâŚ
But anything that has to do with your own game UI has to be either Camera Space UI (Discouraged as it is static in view) or World Space UI.