11 lines
237 B
GDScript

class_name EnemyController
extends Controller
var enemy: Enemy
func _ready():
enemy = owner
func _process(_delta):
var direction := (Global.player.global_position - enemy.global_position).normalized()
enemy.set_direction(direction)