UE4 World Wrap Options?

Hey,

I would like to know what options do i have if i want to implement world wrapping?

I have a Side-scroller and i want the players to see each other on the 2 sides of the map.

I need a solution that works well in multiplayer too.

Good question. If it’s 2D have you considered that viewport2d camera thing? with a trigger that physically jumps the player to the other side?

Well not really since it’s 3D. Maybe someone at epic could give me some ideas about it?

Hey Azarus-

When you say world wrap, are you referring to a PacMan-esque setup (going off the left of the screen makes the player reappear on the right)? Can you provide a little more information about how the project is setup? Is your camera stationary or does it follow the player? In the case of multiplayer, is it a single camera with both players on screen or is it split-screen with each player having their own camera?

Hey,

Yes, i do want the character to reappear on the right side of the level when its going off the left side of the level (and not the screen)

Also it is multiplayer and one single camera follows the player. So it is not split screen.

My goal would be to make a seamlessly loopable 3d sidescroller level.
Where one player can go left or right and you can go back to the same location.

Thank you for your help! :slight_smile:

Without seeing the current setup I can’t say if this would work for certain, but you could try adding a trigger volume to the left and right sides of the level. When a player enters a trigger volume, you can have their character teleported to the opposite side of the level.

Cheers

That’s exactly what i have in my mind too but i can’t figure out how can i change the location for the characters and for physics simulated actors. The server is overriding the character’s location.
Can you give me more information about it please ? Thanks.

If you are using code and created an actor class for the trigger volume, you should be able to add a function bound to overlap that calls SetActorLocation for the overlapping actor. This will move the actor overlapping with the volume (the character) to the desired location. You can also set the rotation to have the character facing a specific direction as well.

Thats right but the server is overriding its location in the next tick and the actor teleports back where it was. I need a multiplayer solution…

I am not seeing that behavior in testing on my end. If you have a trigger volume on both sides of the level, make sure that teleporting from one side to the other places the character outside of the trigger box on that side. If you are still seeing the player teleport back to the starting location, can you post a copy of the project you’re working in or a sample project showing the issue you’re seeing? You can post it as a zip here or upload it and send me a download link on the forums for privacy.

Using trigger boxes will make the characters to pop in from nowhere, and teleport my character to a new location. I’m sure that way it won’t work.
Is there a way to offset an actor’s location only on one client?
So i can use a modulo function and teleport the other actors to the other side of the map and leave my character at the same location?

I’m not sure I can provide other solutions without a better understanding of what your current setup is. Let me know if you’re able to provide a copy of your project to investigate this issue directly.

Okay so you don’t know either :frowning:
I’ll get back to you when i figured it out. :slight_smile:

I was able to solve this issue by using a cylinder and just having the camera follow the character. And since a circle is endless the player always returns to the same position. With some manipulation to the physics behavior the issue is solved.
The world just needs to be big enough so the curve of the leve is not that visible, which in my case is not a problem.
And it works very well for 3d side scroller games. Not sure about 2D, but i don’t see any problem implementing this there :slight_smile: