Why transform.TransformPoint(transform.position) prints differently than single transform.position?

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));


print (target.transform.position);

The two print instructions give these information respectively:

(2X, uncertain relationshipY, 2*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.

TransformPoint() translates a point from local space to world space. ‘transform.position’ is already in world space. The local position of an object will be Vector3.zero, so if you want to compare the two, use:

print (target.transform.TransformPoint(Vector3.zero));