- Home /
CanvasGroup.alpha hides the UI in Scene view but not in game view.
I was trying to make a strip of buttons, and wanted to use the canvasgroup's alpha to disable it. however even though in scene view works fine when playing, it does not in game view. Here's what happens:
http://i.imgur.com/5Ha2QNN.gifv
This is basically what i'm doing, nothing too complicated:
void ShowMenuStrip()
{
_menuCanvas.interactable = true;
_menuCanvas.blocksRaycasts = true;
_menuCanvas.alpha = 1.0f;
}
void HideMenuStrip()
{
_menuCanvas.interactable = false;
_menuCanvas.blocksRaycasts = false;
_menuCanvas.alpha = 0.0f;
}
Am i missing something?
Answer by hexagonius · Jan 31, 2017 at 05:00 PM
The game view does not show the background. Is there anything clearing the frame buffer, any camera with clear flags background or skybox? since the scene is otherwise empty it looks like the buttons would be invisible, but are still on the frame.
Oh yeah, that was it, i wanted to hide the skybox and did set the clear flags to don't clear! did not know that, thanks a lot!
Your answer
Follow this Question
Related Questions
How to change the alpha of the whole canvas? 1 Answer
How to hide Canvas? 1 Answer
Distribute terrain in zones 3 Answers
Object Instantiate Image to Canvas, Object destroy, Image destroy? 1 Answer
Unity UI World Canvas Scale Reason 0 Answers