orBeat
orBeat

Reputation: 125

Unity - Screen overlay canvas is visible through wall

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. enter image description here

Upvotes: 0

Views: 2518

Answers (2)

Salvatore Ambulando
Salvatore Ambulando

Reputation: 422

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.

View of the Unity hierarchy with a cursor over two buttons to the left of the Canvas item

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.

Upvotes: 0

Robin
Robin

Reputation: 1261

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.

Upvotes: 2

Related Questions