- Home /
Infinite map size: respawn you at the other end?
In some old 3d games, when you reached the end of the map, it would re-tile the same map backwards at the opposite end so that you would seamlessly make an infinite maps?
How easy would it be to achieve this effect in Unity, Say you made a nice large map that was symmetrical or seamless at the edges, you would just respawn at one end when you near the other? It would be better even to tile symmetrical copies of maps together, could it be done????
Answer by red 2 · Jun 10, 2011 at 12:17 PM
as i see it, its pretty easy to realize. simply have the player collide at the spot where you want the map to end, then set transform.position to the other end of the map (you could use the point of collision to calculate that) and there you go. if you have any kind of obstacle on the maps ends like hallway corners or similar, which prevent the player from seeing further than that point, you dont even need to display the "further area". just think of how valve solved changing maps in half life back then. when you reached a certain spot it loaded the next map and placed you in a location looking identical to where you left the last map, so it looked like if there was no change. do the same just with changing position instead of loading a new map, and there you go.