- Home /
World Space Coordinations are different ?
So I have bunch of imported objects, parent, childs everything is mixed and not at zero position in transform inspector panel. I thought that if i will get transform.position I will get coordinates related to the world space origin and EVERY object have te same origin in world space. But no. When i do that every object seems to have different origin in world space how it is possible ? To show the problem lets say i have two objects on x axis really close to each other and they should at positive but one shows -4.57 and another 10.4 ??? Why is that :(((
Answer by Spip5 · Nov 16, 2020 at 12:38 AM
Transform.position returns the world space coordinates (the "real" coordinates). Transform.localPosition return the local coordinates (coordinates relative to the parent). The Transform component in the inspector, however, shows the local position (thus relative to the direct parent).
Compounded on this, an object's origin point is not required to be anywhere near its vertices. For example, if you defined a square's vertices in 3D space as:
(5, 5, 5)
(5, 5, 6)
(5, 6, 6)
(5, 6, 5)
then it would always appear to be a significant distance away from the position described by its Transform data.
Your answer
Follow this Question
Related Questions
Maya objects with different transforms. 1 Answer
From 2D UI coordinates to WorlSpace 1 Answer
use world axis when using transform.rotate 0 Answers
Simulating different gravity, how to make falling platform fall in the desired direction? 1 Answer
Clamp position x and z based on local x and z position 1 Answer