Unity - Screen overlay canvas is visible through wall - unity3d

How do i properly use Overlay Canvas so that it is not visible over walls. As seen in the image below the canvas is seen through the wall(the white line in Game view). I am using a free roam camera that you can freely move in the Game. I tried using Screen Space - Camera canvas but when i move my camera in Game the edges are flikering.

What you are seeing in your game view is the "Gizmo", which shows the canvas outline. If you disable gizmos in the game view (top right of the game view, just click the "Gizmos" text", the white line will no longer be visible. This wouldn't show in a build of the game even if you have it enabled in your editor.

As Robin said, what you're seeing is just the canvas gizmo in the scene view. It's so big because it's scaled in world units to the resolution of your game view.
If it's getting in your way you can hide it without disabling it or turning off gizmos by clicking the little eye icon in the left of the hierarchy. The little finger icon will disable selecting it by clicking in the game world, so it doesn't get in the way of trying to select other objects.
If you're using an older version of unity, you may need to just disable the canvas and remember to turn it back on before you build, or disable gizmos.

Related

How can I create a Plane in Unity, that always shows up when using the AR-Camera in an App

I have an AR app, where I want to have a plane with text on it, that is always shown when using the AR-Camera.
The Programm only uses the AR-Camera. The Plane doesn´t show up at all so far, even though it does in the preview.
The Plane doesn´t show up anywhere in the AR environment.
I don´t really know what to add since I think the question is simple. If you need further details just let me know.
Little Update: After the start of the app and after the Unity Logo shows up, the screen is black for a few seconds and during that time I can see my Panel on the black background. As soon as the AR-Camera is activated, the Panel is gone.
Here is how to do it in 3 simple steps:
You need to add a Plane object to your Unity's scene
You have to align the Plane in the view of your main Camera's object, to your liking
You have to set the Plane as a child of your Camera's object by simply dragging your Plane entry to Camera entry in the Scene Tree Editor Pane (located in most cases on the left side of your Editor's window)

Screen Space - Overlay Canvas for VR in Unity

How can I get the effect of Screen Space - Overlay Canvas on VR?
I want both of the eye cameras to have menus in the exact same positions.
I don't want to mix it with world space, so the only option I can think of is having a duplicate of each UI element, one for each camera.
Am I missing a simpler solution?

Canvas UI does not render in GVR (Google Cardboard) in Unity 5.3.5

Background
I am using Unity3D 5.3.5 to develop a Google VR (Cardboard) project
Introduction
I added a canvas button to my scene. It shows up in scene mode and sometimes in Game mode but never when I run the project
What I have tried
Turning off Direct Render for Main Camera
Setting up Render Mode of canvas to World Space
Adding Main Camera to Event Camera
Observations
Button shows up in Scene and Game Mode but not during Play mode
Though the UI does not show up, Physics Raycaster in the reticle hits the button.
Screenshots Below
This is a Unity bug. In the forums they mentioned it will be fixed in 5.3.5p5.
Its also noted in known issues for gvr:
Starting with 5.3.4p2, a bug in Unity prevents rendering World Space
uGUI Canvases into a RenderTexture
https://developers.google.com/vr/unity/release-notes#v080_initial_release
It works in older version(5.3.4f1), if you need to test it right now.
in your canvas change Render Mode to-> Screen Space Camera
change Render Camera to -> Your camera
change Plane Distance to a very low number but not negative

Unity canvas rect shows in game mode

After adding a GameObject -> UI -> button to my Unity canvas, when in game mode the canvas rectangle is showing up when I don't want to see it. It should only be visible in scene mode. How do I ensure that it is not visible in game mode?
Check if Gizmos is On. Turn it Off and outlining rectangle would not be visible in GameMode. Or it can be an Image component attached to canvas if you are talking about filled rectangle.
it turned out that when i built the game on android the canvas rect is not invisible (it is only visible in unity editor).

simple UI menu and canvas for DK2

I am using Unity 5.1.2p3 with DK2 SDK 0.6.0.1 and I understand from this post that Screen Space - Overlay is not supported in Unity VR. It is recommended to use Screen Space - Camera (which in my case does not work) or World Space (which I am using now) but I need someone to help me understand how I get simple menu with buttons and toggles to show as a still image and how I can make selections and button presses with my mouse cursor.
I have created a menu for my app, with 4 toggles and 1 button. When I check the Virtual Reality Supported option with the Oculus being in Direct Mode and Canvas being in World Space, I can see it in VR, but I cannot see/find my mouse cursor to tick one of the toggles.
When I take off the headset, on my monitor's Game View tab, I can see and even use the mouse and select a toggle. Obviously, I have to keep the headset steady, so in my Game View, things do not shake!
Another thing I notice is that the VR camera is the same as the Main Camera in the Unity Hierarchy, but when I take off the headset and move it around, the position of the camera does not change, only looking up and down and around is reflected.
How do I simply do a static menu like a 2D surface that does not move in VR and a user can use button presses and muse clicks with the headset on? What settings are required for this way of doing UI and canvas stuff? There are 2 attachments, showing my current settings...
Are you specifically wanting to use the mouse? If you look through a blog entry I wrote below, it will show you how to use Gaze looking to trigger menu buttons:
http://talesfromtherift.com/vr-gaze-input/
You can achieve this by some code I list there that raycasts from the center of the screen and if it hits any UI, it will trigger the correct events and make it clickable by button (or by time).