Removing played level - question

Hello!

I have some kind of problem which I can’t figure out for few days already and I know that for some of you thats something really basic.

I want to create system where there are 5 levels.
First level is main.

In first level player push the button and then randomly it select one of 4 levels to play.
Once on level 4 player push the button again, game choosing rest of the levels to play (and level 4 need to be removed from the array since we played it already and can’t be choosed randomly again when we play other levels).

1 Like

I assume you’re using ‘open level’?

You need to keep the array of levels in the game instance. When you load the first one, you can take it out of the array, then ask the GI to load a random one

This vid just shows you about the GI. If you get stuck, just come back here…

Hello!
Thank you for your answer.

So basically…I stuck

I created the game instance, put there Selected Level variable.
This code is inside my button blueprint, because I just want that when I push the button in the end of the level, player goes to random level and the level he played is removed.

I know that there need to be Random Integer in Range and Remove Index somewhere. But I’m really lost…

1 Like

Button code

Game instance

Result

RandLev

Oh my!

Thank you very much! I literally spent on it about 3 days and you did it in few minutes.
I hope one day I will have that knowagle as you. Thank you again!

1 Like

Keeping going :slight_smile: