How to make a smart warp system?

Hello everybody. A few months ago I developed a 2D RPG with tiled maps, in that classic Pokémon-style, and I had to create a warp system so the player could go from one map to the other, like in Pokémon, when the screen fades out and the player appears on the other area. And for that, I used Box Collider 2D as triggers, both to warp the player to the next map, and to instantiate the new map. But I had like 10 maps per scene, so each scene had like 30 or more triggers, and I had to assign where the player would appear and where the map would appear in each script manually, and it took a lot of effort, and dozens of hours of work. I’d like to know if anyone has some suggestions of a non “go horse” way of doing, like the one I did. Thank you.

Yowza, that sounds like a lot of work!

Depending on how you’ve got your scenes and logic set up, there may be superior ways. As with all things programming, different situations call for different solutions. YMMV.

It sounds like a job for a map editor. Imo, this is a scary term that drives newcomers away. A map editor is just a suite of tools that help you work smarter, and you can build them one at a time for specific tasks like this.

Your tool could’ve offered you a button that somehow marks the warp tiles - departure and arrival - with metadata that makes them “know” each other. This could’ve been automated to the degree that you could’ve set up each warp with a few clicks.

How to best add that markup - e.g. automatically creating BoxCollider helper objects and automatically cataloging them for easy inspection - will vary from case to case.

Creating tools for yourself is often a good way to think about problems: Not just how to solve XYZ problem, but how to solve it a hundred times down the road very efficiently.

Just some basic suggestions:
If you haven’t already, make a warp zone prefab, to cut down on some time. If the maps are in the same scene, you could make a “link warp zone” prefab consisting of two warp zones that warp to each other, possibly changing the destination slightly if necessary to facilitate player direction. Make use of public variables to streamline fine-tuning if necessary.