How to stop eventbeginplay event repeating

Hi, first post on here so apologies in advance for the noob question. In my game I have created, in the levels blueprint on event begin play I have set a widget to appear (like a main menu of sorts) and towards the end of the game there is a triggerbox that loads the next level, now when this next level opens the widget reappears for some reason. I’ve researched this and the only thing I’ve found is something called the ‘do once’ node but im unsure as to how to use it. any help would be appreciated thank you :slight_smile:

do you have the create widget and add to viewport nodes on the blueprints of every level in your game and not just the level where you want the widget to appear?

its just on the level I want it to be on, but for some reason its appearing on the other levels too, also thanks for the quick response.

doOnce right after the beginplay should work on a persistent blueprint that doesnt get created and destroyed between level travel (such as gameinstance) but most blueprints are Actors which means they fire Beginplay when they are created in the world as the level they belong to loads, or when tbey spawn if they werent part of the level.

This makes me think maybe there is code somewhere else that is not your level blueprint, telling the widget to appear.

OR it may be that the widget is in your default HUD blueprint (selectable under world settings along with default player controller default game mode etc), and therefore will automatically already be on the screen unless you apecifically tell it to hide or destroy the wdget when the level begins.

I would create a Bool on the begin play, so first level the menu is shown and after this “Add to viewport” make the bool to false and check it in the next level if it’s true or not. Bool → true → add to viewport //// False → continue without.

thanks mate ill try this and the guy above’s suggestions :slight_smile:

Tried all you suggested, ive turned my level inside out looking for other references to it but its non existent anywhere but on the start levels blueprint. iv’e also checked the HUD blueprint and there is nothing there either :frowning: any other suggestions?

Edit: that fixed it, took another look at the HUD thing and it worked! thanks so much mate :smiley: