Am trying to ma the enemy follow the player,
but problem: I can refer to the player (or the player scene) in the script.
The Player and Enemy are both in the root folder
THIS IS MY CODE BELOW:
var path = 
var path_node = 0
var speed = 10
onready var nav = get_parent()
onready var player = $"Player"
if pathnode < path.size():
var direction = (path[pathnode] - globaltransform.origin)
if direction.length() < 1:
pathnode += 1
moveandslide(direction.nomalized() * speed, Vector3.UP)
path = nav.getsimplepath(globaltransform.origin, targetpos)
path_node = 0