get position of a node in the scene tree

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

Hello, I’m trying to spawn an item from the inventory node, but I want to spawn the item using the player’s position as a starting point. How would I access the player node to get its position? Thanks in advance!
Scene tree

This was my attempt at getting the players position:
code

:bust_in_silhouette: Reply From: WannabeDev

after trial and error found the answer:

var playerNode = get_tree().get_root().get_node(“./World/Ysort/Player”)