This function creates the required Euler rotation for one position to face another, and returns the result as a pipe-bar delimited list.
VectorLookAt([Origin Position], [Target Position])
Where:
Origin Position is a pipe-bar delimited list representing the origin position vector (X|Y|Z).
Target Position is a pipe-bar delimited list representing the target position vector (X|Y|Z).
Rule | Result |
---|---|
VectorLookAt("1|2|3","4|5|6") | Will return the Euler rotation for the origin to face the target, 35.26|315|15 (values have been rounded for clarity). |
Due to floating point precision, some calculations may not be as precise as expected.
This can be avoided by following the advice in the topic Info: Floating Point Precision.