Hi there people ! I’m alexis and i’m a beginner in Unity3D ! I’m working on a 2D project and i’m trying to do an endless world (not minecraft kind of endless). I just want to do it’s like the map on Cortex Commnad, you can walk infinite time to the right or left and you always going to come back to the start (like make a round around the world). I’m using RagePixel for the sprites. Is there any kind of camera “trick” or something ? Thanks !
anyone? please help !
Well depending on how your background world is set up their are multiple ways, you in particular said you wanted to loop around so if the the background world stays still you can set your player to pop back and forth from one side of the screen to the other if it hits a certain spot so if the player reaches a certain point in the world space like negative seventeen along the x axis it will disappear to positive seventeen along the x axis. Or if you want the background to move you can have your background pop back and forth instead of the player. To give you an example if you have three planes that make up your background you would have one on the screen at any particular point and have them translate as the player moves sideways and constantly loop around their position. I hoped i helped or at least gave you an idea.
I like that, but should i move the player or the world ? So far I found two possible solutions but do not know which would be better to implement (or if any can get to work):
- Create three objects “world” and put them in an array of 3, with the middle one where the player is standing / walking. If the player moves to the “world” on the right or left, it rearranges the array, leaving the “world” in the one standing / walking in the middle, delete the other two and recreate one on each side. (It is quite complex and so far I’ve tried but without success)
- Have three “worlds” also, in the middle is where you move the player, the other two will be to give the feeling that the world started again. When the player reaches the right edge of the “world” will teleport the player to the left limit, as they keep walking. The problem with this is that probably notice that was sent from one side to another map …