Topic was automatically imported from the old Question2Answer platform.
Asked By
CrazyM
Old Version
Published before Godot 3 was released.
I found Spatial.get_translation() which returns the local Vector3 position, and Spatial.get_global_transform() which returns the global Transform, but I can’t figure out how to parse the Transform to retrieve the global Vector3 position.
No problem, I also had to look it up because I only knew about the 2D case. For reference I just looked for the Transform tutorial in the docs. Most of it talks about the 2D case but at the bottom there is some 3D information which mentions that in 3D origin and basis are separated instead of being packed into one 4x3 matrix.
umfk | 2016-03-02 19:40
Yeah, I see it in the Transform class member variables now. I had already looked there several times, but it just didn’t click. Thanks!
CrazyM | 2016-03-02 19:55
And for those who wants only the X, Y, Z… Just add .X,Y or Z on the end of the code: Like: