Hi, I am looking to find out how to have a screen wrap where on top down and camera static, if the player goes off stage to the right, they return on stage from the left. A link to a tut would be great too. As I am having a hard time finding any. Thanks
I guess it depends on how complicated you want it and how dynamic your play area is. I built a rudimentary asteroids clone as a test, and set up trigger volumes in all four ‘walls’ of the play area. When an object entered that trigger I simply moved the actor to the other side of the screen (with the same direction vector as it had when it left).
You then just work out the actor bounds of the trigger volume using Get Actor Bounds, which will give you your entry point back in to the screen. Of course if you know your X,Y coords of your screen bounds you could just hard code it as well.
And you might be able to use your camera to see if the object goes off screen, but I don’t know how effective that is. There is also the ‘isVisible’ tag as well, but doing that on each object would be expensive I would imagine.
I did some reading on this a while ago. From what I found the easiest way is to fake it with two copies of your player, each fixed at a screen’s width (whatever that is for your game 2D or 3D) one to the right, one to the left. So when your character goes all the way to the left side of the screen the clone on the right shows up, and vice versa. Like this:
clone1-------| player |-------clone2
This way you have part of the player showing on each side of the screen. Alternatively if that’s not important to you, then just setup trigger boxes and teleport from one side to the other.
Ya, this and teleporting seems to be the only way currently. No wrap screen features yet in UE4. lol Thank you both for your help though.