Asteroid-esque teleporting

I’ve been trying to create a seamless teleport system where the player can move from one side of the screen to the other. Currently I have a system that is working however its blueprints were very colluded and it also cannot teleport diagonally and it also works on a timer cooldown, which means with this system diagonally teleporting would be very painful to develop.

I am wondering whether anyone has any ideas how you could make it work?
Currently I’m trying to allow teleporting only after it has left the teleporting areas (collision boxes) however because the player goes from one collision box to the other collision box on the other side of the screen, it goes infinite. Furthermore, when moving very slowly, it can ruin the teleporting because the player won’t see their character for a while. This has to do with the boxes not sitting at the right spots, but that kind of finnicky work shouldn’t be an issue for the feature. However maybe that’s just me wanting too much out of it.

I think I could get it to work if I build enough logic for it, however I was wondering whether someone else knows of a better way to build this, because this feels excessive.

If anyone has any advice or anything that they think could help, please share it.

All in all, I need blueprint logic that allows seamless teleporting from one side of the screen to the other, including corners.

If anything is needed from screenshots of blueprints and more, do ask!

1 Like

What do you mean by ‘one side of the screen to another’?

Also, is this third person?

1 Like

Ah - you mean like the game Asteroids?

1 Like

Ok, I can tell you a couple of ways, but it really depends on what kind of ‘character’ you have.

If it’s a fully fledged one, then this might work

If it’s a simplified spaceship ( like the original ) you could just use a material wrapping around a cube to do it.

Needs some more info…

1 Like

Hello there,

It is exactly like the game Asteroids! There you can move as slowly as you want and go into the corners and you will always appear on the other side. It is very smooth in that game and I was wondering whether something like that would be possible using ue4 with blueprints. I can send screenshots of what the game looks like if that would help?

If you want it like that, then just moving a texture around the background would do it.

I can give you an example, but it won’t be until tomorrow… :sleeping:

( maybe a couple of screenshots would also help… )

2 Likes

Tomorrow is okay I do not need it fixed today per say.

If your example doesn’t help me I’ll show you some screenshots. Or I’ll just add them regardless tomorrow evening when I have time.

Thank you already for the quick replies!

2 Likes


Sorry for the hazy look, the build isn’t optimized.

Anyway, the character is currently in the middle.
I want it to be able to go out on the left and back in on the right.
I’ve been able to make that work, however with a cooldown timer.
The biggest issue currently is getting that to work in diagonals.
Due to using collision boxes I’m afraid when it goes into the corner it will only teleport the overlap it sees first.
And due to it working on a timer it then won’t teleport the other way.

So for example you go top left. It reads that you are overlapping the top collision box so it tp’s the player to the bottom left. But then because of the cooldown timer (which is only there to apprehend infinite teleporting, not a design choice) it won’t teleport the player from the left side of the screen to the right, which means the character will continue to move outside of the camera viewpoint.

I’m currently in the middle of trying to solve the problem myself by creating two arrays of the top-bottom boxes and the left-right boxes, and then allowing either to teleport from one to the other box. And then once they leave the other teleporting box it will reset and allow teleporting again. However that already has a flaw in that the player could fly as slowly as possible and then stay in the box it was teleported to, and move out of bounds that way.

Because of all these problems I feel like there ought to be a better way to do this.
Please tell me if you have an idea that could work or if there are any questions you have :slight_smile:

This was what I was thinking about. If you move the UVs around a cube, you get this

asteroids

1 Like

1)add a new variable of type boolean to the character
2)in begin overlap make a branch if the variable is true then do nothing, if the variable is false then teleport the character and change the variable to true
3)in end overlap change the variable to false

so every time you jump from one collision box to another it will check that you teleport recently and you won’t get stuck in a loop

thinking in 3d to make it seamless you would need to teleport the player controller instead of the character

just use another character that copies your movements synchronously when you get close to the edge of the screen and change the player controller when you cross an edge

This is exactly what I need I think!
However can I still use actor overlapping events and hit events?
Would I need all my entities (like enemies) to also move around the cube?
Even though they won’t be teleporting?

Sorry for the delay and even further questions.
But I think this would allow me to teleport diagonally which is exactly what I need!

No, nothing like that would work, that’s the problem.

In the original, it was just some machine code wrapping the pixel locations, so you could have the front part of the ship coming in bottom right, while the back was going out top left.

I have seen other ideas, where you have more than one ship. Meh…

I guess you could have the ship made out of some number of small parts, which you could sort of do the pixel thing with.

I’m gonna think about it a bit…

PS: Is it going to be a strictly 2D experience, or some sort of 3D hybird?

1 Like

It is strictly going to be 2D. I’m still learning so when I was building this I basically used 3d assets for everything. But the game will be 2D for its entirety.

1 Like

I’ve been an idiot!

Your first response relating to the other forum actually ended up working! For corners as well!
Here is a screenshot of what the blueprint looks like in the end:

It is just the same thing copied twice, once for x value and the other for the z value.

1 Like

Can you show it working? :slight_smile:

1 Like