- Home /
Map looping
Hi
I am not sure of the term for this.
But I want to create a square 2D map. When you walk to any side of it, you end up coming out from the other side.
However the camera is always centered on player.
Any ideas how to do this?
Thanks!
Your player can move in any direction freely or just up, down, left and right by 1 square?
Your world should be divided on 4 sections. Each time when player moved close enough to border of world. Just move opposite sections in front of player (and everything inside those sections)
Answer by Fobri · Dec 15, 2016 at 03:09 PM
You could make empty GameObjects on the sides of the map, set them to have box colliders with "Trigger" box ticked, then give them a script that get's the incoming collider and if the collider's tag is ie "Player" set the player's location on the other side of the map(by moving the player on x/z axis by the map width/length)
Your answer
Follow this Question
Related Questions
Changing who serves in multiplayer pong 2 Answers
map generation issues 0 Answers
Infinite map size: respawn you at the other end? 1 Answer
Assigning UV Map to model at runtime 0 Answers
Tiled2Unity - looping map 2 Answers