How can I obtain the position shown in the inspector through the script?,How to get the position shown in the inspector in script.
I am new to Unity and the way position works is deeply confusing to me. The inspector gives the objects x position as 2 while transform.position.x gives it as 4.76967 and transform.localPosition.x says it is zero. I would highly appreciate an explanation of how position works within unity and how I can get the script to display the position found within the inspector.,I am very new to unity, but I am trouble understanding how position works within unity. Although the x position shown in the inspector is 2 the position given by transform.position.x is 4.76967 and localPosition gives the position as 0. If someone could give an explanation of how position works within unity and how to obtain the position shown by the inspector within the script I would be deeply appreciative.
Your answer
![](https://koobas.hobune.stream/wayback/20220612171631im_/https://answers.unity.com/themes/thub/images/avi.jpg)