- Home /
 
Enable/Disable Blocks Raycasts within a Canvas Group using code [Help Appreciated]
Hey everyone! So here's my obstacle. I am working on an inventory menu using the canvas layers. I have buttons working just fine. I messed around with the visibility with a canvas group adjusting the Alpha switching between 0 to 1 and vice versa.

The top layer that I'm messing with the Alpha is blocking the buttons below it even when it's at 0, I need to set it so that Blocks Raycasts is only enabled when the Alpha is at 1. GetComponent I believe is used but I don't know how to reference the Blocks Raycasts in code.
Thanks in advance!
Answer by DragonFang17 · Sep 19, 2016 at 05:17 PM
silly me!
accessing the blocks raycasts is as easy as
canvasGroup.blocksRaycasts = true;
or false
Your answer
 
             Follow this Question
Related Questions
Unity 5 GUI Buttons Won't Show When Built 0 Answers
How to attach a (that world type) canvas to a moving player? 0 Answers
Having a bit of trouble with Unity5's canvas 1 Answer
How to make a UI Canvas not appear again after the first time the user hits the "I Agree" button. 2 Answers
Text Colour Gradually Change Animation 0 Answers