- Home /
How to get object's X,Y,Z location within world via script?
Total newbie here.
How do I get an object's X coordinate in the world via script? I see this is done in the Inspector, and I'd like to know where this info comes from.
I tried using transform.position.x, but this gave me the distance between two points in the world, which is not what I want. I need the absolute value of where the object exists in the world.
Comment
Best Answer
Answer by raoz · Mar 26, 2012 at 09:47 PM
transform.position.x it is, debug it out in the update and you see ot matches
You're right! It was transform.position.x. I was looking at some other numbers in the debugger. Thanks, raoz for the confirmation!