How can I get the coordinates of a KinematicBody object on the scene?

    2 answers 2

    global_transform.origin # this hold the global position of the Spatial object.

      Well, smorti.

      extends KinematicBody2D var pos = Vector2() #Создаём переменную у которой есть 'x' и 'y' значения func _ready(): pos.x = global_position.x #Передаём значение 'x' переменной pos.y = global_position.y #Передаём значение 'y' переменной print (pos) #Выводим позицию, можно ещё так: print (global_position) 

      If you want to display a specific value, for example, the position on the 'x' axis:

        print (pos.x)