simple problem with ui (canvas) - unity 4.6

hi

i have a simple problem with 2 canvas in scene . one of them have some text and image to display and one other is my menu . after my game finished my menu shows up . but i cant click on the buttons !!! because of images and text on other canvas ! they are like a cover for my buttons ! how can i make them work ?

i know layers and ui order very well . ordering and put them in different layers don’t solve the problem !

what should i do ?

this is a view of my scene :

You can have as many canvas’s as you want you just need to make sure that only the one’s you need are current active or set to interact.

using UnityEngine.UI;    // make sure this is at the top


public Canvas myFirstCanvas;
public Canvas my SecondCanvas;



public void EnableFirst()
{
    myFirstCanvas.gameObject.SetActive(true);
    mySecondCanvas.gameObject.SetActive(false);
}

If you don’t want to access the gameObject and SetActive the same results can be obtained with a CanvasGroup, just add it to the base canvas and set…

Alpha = 0

interactable = false

blocksRacasts = false

To completely hide the panel and

alpha = 1

interactable = true

blocksRaycasts = true

To show and interact with a panel.

Got 3 canvases in my game so far and no issues at all.

Example code in C# although not got access to Unity at the mo so untested.

i use panels and its solved :slight_smile:

I know this has been marked as answered, but using only one canvas and setting anything as panels that must be hidden or shown is kind of a hack, canvas are intended to work for that kind of things.

Recently in my team we had the same problem you’re having, and it was fixed by setting a lower value for “Priority” on the canvas that should receive the clics. Priority was a value set on the Graphics Raycaster component, but… it was removed after version 4.6.0f2!!

After a little research I found this thread at Unity’s forum: http://forum.unity3d.com/threads/graphic-raycaster-used-to-have-a-priority.283851/

It says “Priority” was removed because what we (and you, and a lot of people there) wanted to do should be done changing the “order in layer” value of the Canvas.

But after removing the priority, order in layer was not working for some cases. If you have time and download the different projects that other people posted in that thread you’ll see the same problem you’re having.

If you read until the end you’ll see that this bugs where fixed in version 4.6.2p1, that you must download manually from here: Download Archive

I know it’s not ideal to download a new version of Unity, but you’ll have less troubles with it, and you’ll be able to use multiple canvases.