Make an object leave one side of the screen and appear in the other

I know there’s an extension to do that, but i want the player to appear in both sides at the same time:

What i was doing previously was to make nine copies of the level and arrange them in a square

and then when the player its at a certain x/y position its teleported to the other side of the screen
However this method causes a lot of problems and bugs, such as characters being a little offset, which makes them do not loop properly. Is there another way to d that without having 9 copies of the level?

Maybe try reflection extension but there may be no luck
Edit: Maybe you can make 2 Player sprite and create Player2 at the end and change the position of Player1 at the beginning. And Player2’s default control should be set to No.
Now, whenever Player1 is moving and key right is pressed: Simulate left key for Player2

1 Like

Hi to move the player as he reach’s the screen end. Check this example GDevelop 5

1 Like

But he wants the Player to appear at both sides

Could you not have an off screen block/barrier called “left spawn” variable 1 and “right spawn” variable 2 and when a character/enemy hits one, it sets a object variable to that character. Hit the left barrier set character object variable to 1. If character object variable = 1 set character.X() 400 ; Set characterY() 400
position of right spawn. witch should move character to the other block

1 Like

I didn’t exactly understand what you said, but as far as I understand, it somewhat works but he needs Player from both sides. He goes beyond camera limit in Right and comes form Left but Right also.

You could use just the one level and create 4 copies of the character, but each with no behaviours attached. Update the position of these 4 copies as 1 of them a screen width to the left of the player, another a screen width to the right of the player, another a screen height above the player and the final one a screen height below the player.

Then when the player is fully off the playing level (off the top, bottom or the sides), adjust the player position by a full screen width or height so they’re back on the screen.

1 Like