Distance of two objects (depended on rotation)
Hi everyone,

I have a puzzle for a smart mathematic or Unity expert :)

I want to spawn a scientist (A) in Compound monument (B) in certain place and repeat that automatically after wipe

1/ get distance from A to B (Vector3.Distance is not enough as I need to have rotation involved)
2/ what data to store for scientist A (Vector3 and rotation)?
3/ how to apply to get new postion for scientits A when I get new position (and rotation) of the monument B after wipe

Scientist should look in the same direction. Practically I could stand on the position of the scientist -  type some command and it should get the data of myself againsts the monument. 

I'm pretty sure that it is something that some plugin already has but I'm not successful to search for that properly.
Hi,
You want the npc to have the same position and rotation relative to the monument, even after a see change where the monument will have moved?

You could store the monument location and rotation (old and new), and the npc location and rotation.

Your npc's new position after a monument move is
newMonumentLocation + (oldNPCLocation - oldMonumentLocation), 
rotated around the new monument by
-oldRotation +newRotation.

For look direction you'd want newMonumentRotation + (oldMonumentRotation-oldNPCRotation).

Not sure if there's a simpler way. Hope that makes sense.