Variable that saves the visibility state of my widget so I can turn off hit state for my other widget

I have a widget that turns visibility on when the motion controller line trace hits the object.
I’m not sure how to create a variable that saves that state for when the widget is visible…

Goal- widget visibility is true disable hit detection for widget2…