I want to hide a certain widget only while a specific level is open.
However, because the widget is quite complex, using Remove from Parent doesn’t completely remove it as expected.
So instead, I’m thinking of disabling the node that executes or creates the widget, rather than trying to remove the widget after it’s shown.
Is there a way to disable the execution of a node only while a certain level is open, and have it automatically go back to normal once the level changes?
For widget to know make event dispatcher in blueprint that changes levels be it game mode, bp_hud, player controler. Do no put loading level logic in actors or widgets, better is to palce it into blueprint that is always loaded like game mode.
So with middle man and way to tell your widget that “hey level changed” next task is to hide widget, and it is silly easy. Set its visibility to Collapsed or Visible.
Thank you very much. I created a healing widget based on this video, but I’m not sure which part of the blueprint I should apply Set Visibility to set it to Collapsed.
In big projects i do not condone such stuff, but you are learning.
For bigger project keep level loading logic in same blueprint, and let ONLY know widgets that something changed. Or even better make dispatcher in place where level loading logic is, and make widgets that need it to hook with that dispatcher. Do not put level logic in widget it will get really messy.
ps.
this code gets 3 different versions of level name, print them all and pick one you like most.