creating PRECISE portals

hi!

i am creating portals using the setup from this video:

blueprint screenshot:

it works fine but i want to teleport from one place/world to an alternate almost-the-same looking place/world/paralell universe
so the teleportation must be seamless and unnoticeable, but its not:

when entering portal 1 from any direction it teleports the player to the center of portal 2 and vice versa
(the player rotation works right)
here’s the layout with player movement:

how to fix that?

thanks in advance :smiley:

Probably best to store the rotation as a variable first as it hits the in-portal then set the rotation for the out-portal as it’s probably a logic thing going on. My best guess anyway.

the rotation works right, why should i change anything about it?

Sorry, reading comprehension whilst skipping over things at lunch, ill take a close look later when I have more time.

When teleported, store transformation of player pawn, and transformation of starting teleporter.

Then calculate relative rotation and location of Pawn to starting teleporter.

At destination put player pawn relative to destination teleport.

Hey!

You are setting the player destination position as the portal2 position in the teleport function, so it will teleport it to the center. You have to find the offset, get the difference between portal1 position and player and then add it to the portal2 position and set that as the destination position. You probably won’t be able to add it directly unless both portals are in the same plane or you are using local coords, but if you take into account the normals of both portals it is just some vector math. (I am not proficient with blueprints more of a C++ guy so don’t really know what you have to use)

thanks all, i am getting the logic

but please give me some further explanation/hints, i am a novice at this :confused:

When the player activates Portal1, get the position of the player and the position of Portal1, subtract them, store result in a variable called PortalOffset. When player is at Portal2, add the PortalOffset to the Portal2 position and there you go.

In simple terms, it should work.

You need to do what Yggdrasil has said. Take the offset and add it to the player. You can see these two images to visualize the idea behind the offset math.

thanks for now!

working on it…

Solved!

i guess this is it, thanks a lot! :cool:

cd03928f0a1e92a3064175b252413196e8fd8f43.jpeg

hey Executron!

please help me with your second example