SetActive not hiding UI element and children.

Hello All,

I have a UI panel with several child elements. I want to toggle it on and off with a button. This should be simple, and toggling on works fine, but setActive(false) does not hide the UI element, though it does deactivate it and all its children in the hierarchy. It’s still rendered, just inactive. Resizing the window will then update the UI without the element, though Canvas.ForceUpdateCanvases() does not.

There does not appear to be a repaint call or equivalent, and it seems like that’s not a great way to go regardless.

Any suggestions?

Might be a bug in the unity version you are using. A work around is to set the canvas alpha to 0.

Yeah, updating fixed it. Was on 2017.3.0f1. 2017.3.1f1 Seems to have resolved it. Thanks!