Hello,
I have two vectors. One is relative to a cylinder object I created (I used the inverseTransformPoint function) and one that I just instantiated as follows:
Vector3 vecX = new Vector3(0,0,0);
I assume the new one I created is relative to the global coordinates (that is the zero, up, right and so on are set to the default).
When I make vecX = vecCylinder, does vecX become relative to the local coordinate system? or does it just copy the x, y, z of vecCylinder and ignore the rest?
Thanks.
It will copy the values. The relativeness of it is determined by how you use it. You can use the same vector3 variable to both set a global position of an object, and set a local scale of some other object. In this case, values in themselves are not relative or absolute, its how you use them.
did you try it? i would leave it at that but that’s not really your question… vecX = cylinder.object.transform.position gives you global, vectors don’t care about transform positions, they just store 3 numbers. if you have a vector used in global space and assign it to another vector, then yes, it will store the same numbers, therefore references the same space. Hence, vecX = vecCylinder just copies. (on the other hand, transforms care, and copies the position vector, coordinate system, rotation,etc. when assigning transforms)