Download

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.

http://9.t.imgbox.com/xTZ5aDkA.jpg

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

http://3.t.imgbox.com/eM4BW5YF.jpg

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?

Thanks!
Jeff

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.