setting visibility or removing a widget

Just as a way to keep things easy, I generally will use one set of blocks to see if a widget needs to be on screen or not, and then either create and add it to viewport, or remove it. See the picture below.




Of course you can change this to suit your game, but this keeps things tidy. For me, it has prevented a lot of yellow “!” warnings in playing. It ensures that if the widget should be shown, it is, but if it shouldn’t be shown, it is hidden. Plus it guarantees that you won’t run into issues with widgets being visible over others and them interfering that you can’t fix through bug testing.

1 Like