onready var player = get_node("MegaMan")
onready var pos = player.get_global_pos()
func _process(delta)
debug_xpos.set_text(str(pos.x))
debug_ypos.set_text(str(pos.y))
The above returns the starting positions, but is doesn’t change as I move about the stage.
9BitStrider | 2017-08-12 18:34
That’s because you’re only defining your position once on _ready. You need to re-define pos before every time you want to check it.
The simple answer is, to take your var pos out of global scope and place it as a local var inside _process: