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?
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.