Download

Teleport to variable locations?

Hi guys.
I am starting a new project that revolves around time travel.
To replicate the effect, I want to have two “buildings” on the same map that are identical. one based in the “future” and one based in the past.
one map will have obstacles that do not exist in the other. I hope to jump from building to building, moving past these obstacles and then back again.

However, I cannot for the life of me figure out how i could keep track of my character movements whilst in the alternate building, so that when it comes time to teleport back, the character has moved in relation to where they moved on the alternative building.

Any assistance would be amazing <3

If both environments are of matching dimensions, then you can define two vectors to act as some sort of origin points relative to which everything else is placed. To keep things simple, it could even be the world locations of your future & past buildings.

Once you have these origin points, all you have to do is calculate the vector from the origin to your player character (player location - origin location) in current timeline. Then add this vector to the origin point of alternate timeline, and you’ve got the corresponding position for your character in that building as well.

^^ THIS ^^ … But you could also just spawn a duplicate of the building in place as well. To do that, make each past / future version of building a dedicated Blueprint (or use Level-Streaming). If that doesn’t fit, then depending on the map, you could just duplicate the building in two locations above and below a certain value of location Z… That way x, y remain the same, assuming buildings are all one floor of course. EDIT: Its not clear too if you’re also trying to store a map of paths traversed. If so you’ll need to keep an array of vectors etc.

For clarity … Your in building #1 (past), 2nd floor in a specific room facing east. You want to teleport to building #2 (future) in a mirrored room, facing east etc etc etc?

If so, keeping the process as simple as possible you’d stack the worlds perfectly atop each other, and simply adjust Z axis for the teleport location.

e.g. Say the Past Building is rooted at Z 0 and the Future Building is rooted at Z 10,000. If your in the past at (X 100, Y 100, Z 250) then the mirrored position “future” position would be (X 100, Y 100, Z 10,250).

Past -> Future : Z +10,000
Future -> Past : Z - 10,000

You can do this with any Axis, but the worlds have to be perfectly aligned on that axis.


Another way to do this is to have specific positions in which you can engage teleportation and simply map those positions.

thankyou guys :smiley: this answered my question perfectly :slight_smile: