When I linetrace and scan the meshes in the enum, a widget appears on the screen. However, when I stop scanning, the widget doesn’t disappear, it stays on the screen continuously. What can I do?
the switch node in your BP has not any sense as it will going to the same place no matter the results (create a widget and put in the viewport)you should create the widget, then STORE in a variable and if no trace, check if you have something in that variable ( with IS VALID ) and if IS VALID then remove from parent. if not you dont have anything to be removed.
so I dont know why you do that switch with everything pointing to the same flow of the logic.
should be something like this:
I want to have something that will say ‘throw away trash’ on certain meshes when linetracing. However, nothing will happen on objects that are not marked as trash, or a different text will appear. Am I following the right approach to achieve what I want?
No. Switch node has one input and then outputs that will continue the flow of the program
according with the input. your input is constant because you didnt plugged anything on it and will be always continuin with the trashbag condition.