HUD Elements Persisting on Level Change

Certain objects in our level will add widgets to the HUD if they are within range of the player.

For these objects, we implement the OnDestroy event, check to see if we have a valid widget, then remove it from parent and nil it out.

However, when we load the menu level, we end up with the HUD elements still displayed:

Are we missing a step, or is there a different event we should be using to make sure we get called before the map changes?


So, for some reason, Event Destroyed does not get called when we load another level. However, Event End Play does, so switching to using that for cleaning up the HUD seems to work.

In the release updates for 4.8 there seems to be much better access to gameMode events in blueprint, maybe this will provide some other functionality for you.