How do I open new level at a chosen location?

Basically, I want a player to walk off one edge of a level and reappear on the opposite end of a new level. Like Pac-Man but with a new level each time.

From the research I’ve done, it seems I need to make four player start’s in the new level at each edge of the map (N, E, S, W) and have a variable carry over from making contact with a trigger in the previous level. That variable is called depending on which spawn it should choose.

For example:
Player touches trigger at North side of map > a variable called ‘North’ is created and a new level is opened > new level calls variable ‘North’ and spawns you at ‘PlayerStart_South’.

224582-screenshot-1.png

Is this possible and how would I do it in blueprints? Screenshots would help if someone can figure it out. Thanks. :slight_smile:

Currently I’ve just got it teleporting the player to the opposite side.

Hey there, when you hit the trigger do you want to spawn a new level inside the current level? What happens to the level you were just in? It’s unloaded?

Either. Which is easiest?

I didn’t even know that was possible. Right now I’m just plopping the character in to a whole new level.
In the future I want there to be hundreds of these ‘chunks of land’ levels, so I’m sure I’ll have to reinvent it using voxel chunk systems in the future, but for now I’m just making a proof of concept.

If it’s something that will have a lot of levels i would say to use the same world and spawn levels instances as you go with [this][1]. You could do something like this:

The ball is the player position and the arrow is the direction he is moving.

Hmm okay I’ll do some research on how to do level instances. Thanks. :slight_smile:

Please mark the answer as correct if you think it was answered and upvote them if they were helpful :slight_smile:

I’m not confident yet if this will work, I have to do some research. I’d love some other answers if there are alternative methods.

Sure no problem :slight_smile: In terms of other options you can have sub levels added into your main level already correctly positioned, but this only works when you know exactly how many levels you are going to need because you are creating an instance in design time. The advantage of this is that you no longer need to define locations and rotations to spawn because you’ll be manually placing things in design time. If you want “a lot” of levels then right now i’m not seeing another way other than creating and destryoing instances on the fly while you are walking through triggers.

And by instances you mean level streaming right? I will want the terrain chunks to be randomly spawned in when reaching a chunk edge. Like, you reach an edge and it randomly picks a new chunk with a random rotation to replace it, so it’s almost like an infinite procedural world, but you only see one chunk at a time.

So yeah sub levels are out of the question, level streaming instances seems the best bet for you.

Are they not the same thing? Streaming levels by dragging new levels in to the “Levels” window is ‘instances’ or ‘sub-levels’? Because when I go to “Blueprints > Sub-levels” it shows the extra levels I have in the Levels window.

When you add a specific level to the levels list in design time you are creating an instance which you can work (add/delete objects, etc) but when you go into runtime that instance will be loaded (if you checked the option), but if you want random segments then it’s pointless because you don’t want that instance everytime in that place, you might want a different one and using the Load Level Instance will allow you in runtime to pick which area you want and where it’s positioned.