¿How do i get a Kinematic body position?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Arielrandal

I want to get a kinematic body position, so i can do move_and_slide(firstkinematicbody - selfposition) but i dont know how to get those positions, thanks for any help.

:bust_in_silhouette: Reply From: antoniodev

You could use print(position) in your KinematicBody script

:bust_in_silhouette: Reply From: Shashank1q

if you are working in the body’s script itself then use position variable, it is already present in your script.
if your body is a child in any other scene then you may want to use global_position
and if you are accessing any other kinematic body from a different script then you need to get its reference first by using get_node("path to the kinematic body").position