Greetings kind reader,

Starting with a known location and knowing an object’s position relative to that location, I need to determine the position with the same offset from another location. I plain English, I am teleporting a player between two identical rooms without him/her being able to tell it happened.

There are simplied images below that should help explain. In all cases, the known location is the yellow sphere, the green sphere is the object (player) whose position relative to the yellow sphere is known, the blue sphere is the second known location and the location of the red sphere (where the player is teleported to) is what needs to be determined. The multicolored lines between the spheres are just there for scale.

I have a feeling this is one of those things that is simple once you know what function(s) to use, but I don’t and it has been ages since I used vector math in school. A combination of trial and error and monkey see monkey do with FQuat, FTransform, FRotator and FVector has led me to a solution for this simple case and ones where the two locations are at varying angles and distances from the Z (blue line) axis.

But I have not been able to convert that solution to one where the floor is tilted as below, where the tilt is known.

And what I really need is to be able to do it for floors with differing known tilts from horizontal and differing known rotations around Z, as shown below.

Ideally it would be nice to be able to do this for a start location with arbitrary known location and rotation and a destination with arbitrary known location and rotation, and I am hoping that with your help it will be possible to do this.

Thanks for taking the time to look at this,

PaganCyC