Help with random level streaming

Hey all!
I need help on how to construct my event graph for what I want to accomplish.
I use VR and have constructed an elevator/transporter. The player starts in one level (levelX), walks into the transporter, closes the door, and push a button (box collision) in which the following should happen when the collision box is overlapped:

When collision box is overlapped:

  1. The current level (around the elevator) should unload (the elevator/transporter is static and is streamed at all times. it is only the surrounding that load/unloads)
  2. From all levels that I have (named “1”, “2”, “3”…) a random level should load.
  3. When the collision box is overlapped again, the current level should unload (an not be able to be loaded again), then a new random level should be loaded.

This should go on and on until there are no more levels to be loaded. I will increase the number of levels but at this point I have level: 1, 2, 3, 4, 5.
When there are no more levels to be loaded (among my levels with the numbers as names) one final level should be loaded, which is the same as the one where the whole game begun (levelX).

I have tired various ways to accomplish this, and been looking for a bunch of tutorials without figuring it out. AI could unfortunately not help either. I am quite new to UE5. Anyone who would be kind to construct how the event graph for the box collision would look like for me and show me how this can be accomplished for me to reconstruct in my own project?

You use level streaming by blueprint ( there are nodes for it ).

The lift goes in the persistent level ( the always loaded level ). All the code to do the streaming can be in the lift, or in the game instance.

All you have to do is

  1. Player goes into lift
  2. Unload current level
  3. Load new level
  4. Player walks out

To load a level

image

To unload

image

Notice, the level reference for this comes from the load node.

The lift can just have an array of level names, shuffle the array, and then load them in the array order.

That’s it :slight_smile:

Hey, thanks for responding! I still cannot figure out how to do this. I have added an image of my event graph for what I thought would work. Anything that I can do to make it work?

Something like

Untested :slight_smile: