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:
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.
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)
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.
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.