Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | overlord666 |
I am making an rpg and need to get my players global position how do I dotaht
Use the get_global_position()
method on the player’s Spatial
or Node2D
node (the method is inherited by the descendants of these nodes, e.g. KinematicBody
and KinematicBody2D
).
Ertain | 2020-07-05 17:17
ertain - that gives me an error on rigidbody
fuck | 2020-07-06 09:52
Whoops, I meant to write global transform
. So the code to use is something like the_rigidbody.global_transform.origin
to get its position in 3D.
Ertain | 2020-07-06 16:23