How would I create a next level button that would work for multiple levels when it is brought up and clicked on by the player?

I Hope I am explaining this clearly, if not let me know what more information I can provide.

How would I create a next level button that would work for multiple levels when it is brought up and clicked on by the player?

Right now I have it working where on the first level when the button is clicked it will bring you to the next level with the blueprint “On Clicked”–“Open level(by Object Reference)”.

But then once I get to that next level I have referenced I can’t reuse that same UI button in the WIdget Blueprint without getting ride of the blueprint which opened the current level.

Is there a way to make that next level button always take you to a different level without creating a new UI for each level?


1 Like

You can have the level refs ( or names ) in an array in the game instance.

When they press ‘next simulation’, you change the index in the game instance, and load the next level :slight_smile:

The widget gets the level ref or name from the GI.

Thank you! I know this is asking a lot and if there’s no good way to show how to do it that’s okay but is there a video or screenshots you point me too that shows how you do that?

1 Like

So make a function in your game instance

Then you can call it from the widget

Remember to set your game instance in the project settings

1 Like

You are seriously incredible, I think I may be doing something wrong. I followed everything you did but when I click the next simulation button it just reloads the current level.

Did I do the array wrong? Sorry for all the questions, I don’t anything about coding and am more focused on level design which is why I have all the questions.

Did you put the other bit of code in for the button?


I think I did it right

Hold on…

I figured it out! I just had the variables numbered wrong, I didn’t need the start level in the array and once I changed that I brought me to the next level!

Thank you so much for your help with this!! You made things so much simpler going forward!

1 Like

Excellent :slight_smile:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.