From a script attached on an object, which actually casts a Linecast from itself to a "target" object, I instruct to print the following two statements:
print (target.transform.TransformPoint(transform.position));
and
print (target.transform.position);
The two print instructions give these information respectively:
(2*X, uncertain relationship*Y, 2*Z)
and
(X,Y,Z)
Both of the objects, the one with the script attached and the "target" are not parented to anything and their scale values are 1,1,1. They are also both the Cube GameObject.
Isn't it supposed that both statements should print the world coordinates of the "target" object?
Do you think is possible to draw a conclusion from this data or it might be more complicated? Any guesses however?
Thank you very much.
EDIT: I also tried the experiment to just have a script with only the print statements. Moreover, I asked it to print the same for the object carrying the script itself. I get the same result, only that in the second case, also the Y coordinate has a double ratio. So, I guess it has to do with the way I have structured the statements. In particular, any idea how the TransformPoint functions? Since the transform.position is rather straight forward.
↧
Why transform.TransformPoint(transform.position) prints differently than single transform.position?
↧