11 lines
237 B
GDScript3
Raw Normal View History

2024-01-18 22:35:17 +00:00
class_name EnemyController
2024-02-07 22:04:19 +00:00
extends Controller
2024-02-13 10:56:04 +00:00
var enemy: Enemy
func _ready():
enemy = owner
func _process(_delta):
var direction := (Global.player.global_position - enemy.global_position).normalized()
enemy.set_direction(direction)