How to create transitions between levels?

Hello. I’m trying to create “bridges” between levels, so player can appear in two different places on level in dependence of door he choose. I made illustration how it looks:


The player can use right entry on level 1 and he will transfer to center of level 2. If he’ll walk to left bottom corner of level 2 he’ll transfer to the left side of level 1. I don’t know how to make player spawn in certain point (except of player start, but I suppose it’s not fit for that purpose). So, now I think about something like bridges where every entry remember their “partner”, but I don’t know how to implement that. Maybe there is an easy way and I’m reinventing the wheel?

Hey @Texn0krat,
Maybe a better description would be a portal instead of thinking of them as bridges if I’m reading your logic right. You’ll want a function that gets its partner’s location (could go with a simple naming convention finder), and sets the player’s location as the portal.
I hope this can help, and let me know if you have more questions!
-Zen

Yes, the portal is better description). Sorry, I didn’t understand the last sentence. Why should I “set the player’s location as the portal”? The target location should be the portal, isn’t it?

@Texn0krat

Yes, since you want the doors to send to that location, you’ll have to set the players’ location to the location of the portal.

But how can I get location of actor of level 2 in BP of actor in level 1? I can’t even correctly formulate my question(. For now I created that:


I don’t know how to transfer my character to another level. I created a simple actor in another level:

How can I get it in BP by it’s door ID? Or it’s wrong way?

1 Like

You can create and use a custom GameInstance for your game.

GameInstance is an object that persists through level changes. You can store custom variables there before changing level, and retrieve them in the new level.

2 Likes

Oh, thank you! I’m using gameinstance but forgot about levelBP.

1 Like