Get KinematicBody2D position in code

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

I’m trying to access my player’s (KinematicBody2D) x and y position within its attached script, how can I do that?

:bust_in_silhouette: Reply From: kidscancode

You can get the coordinates of any Node2D derived object via its position property.

See Node2D — Godot Engine (latest) documentation in English