I have been using a export variable to get a nodepath and when ever I try to get properties from it the program crashes. I have it defined in the inspector, and it's set to a kinematic body which has a global_position, but whenever I try to run this code:
extends Position2D
export (NodePath) var target
func _physics_process(delta):
print(target.global_position)
I get this error:
Invalid get index 'global_position' (on base: 'NodePath').
I'm very confused, and any help would be appreciated.